Modular

M

Modular

This server is the home of the MAX and Mojo community. Join us to chat about all things Modular!

Join

questions

community-showcase

Hey All! I'm trying to convert an existing python code into mojo which uses jpype for java interop

I ran the code and it said "Java integration is not available in Mojo. Please run the Java part separately." does anyone have experience running code in another language from mojo with low latency?

Working LinkedList using pointers

https://github.com/MVPavan/mojos/blob/master/learn/dsa/my_linked_list.mojo I have created linked list in Mojo, it runs fine with all the methods and deletions. However debug is failing, any idea why ? Also any feedback on deletion, memory leaks is also appreciated....

How to delete/uninitialize a variable in mojo when running through notebooks

When i declare a variable, I am unable to free the memory used by it in jupyter/vscode notebooks. Setting the
variable = None
variable = None
or
del variable
del variable
works in python. Same case with structs, which can't be deleted unless i manually implement
__del__
__del__
. Is there any way to free the memory casually when experimenting with large memory consuming variables in the notebook ?

Why doesn't this work for creating lists?

fn main() -> None:
var any_list = List[Int](range(1, 10_000_000))
fn main() -> None:
var any_list = List[Int](range(1, 10_000_000))
...

max engine leaking?

Apple M2 Max 96G Was trying to run a text2text onnx model, but ram usage just keeps rising (see video). I am using https://github.com/bloomberg/memray as a profiler. Seems like it is the engine specifically...

Bug or optimisation

The following code: ``` struct A: fn init(inout self): ......

Matrix Multiplication (matmul): `numpy` hard to beat? even by mojo?

Super interested in mojo and wanted to try out some of the documentation/blog examples. 🤓 🔥 https://docs.modular.com/mojo/notebooks/Matmul Great explanations and the step by step speed improvements are amazing to see! 👍 ...

Is Mojo suited for developing optimization algorithms like genetic algorithms?

The major purpose of Mojo is for AI, is it suited for developing computational optimization algorithms?

Mojo extension in Vscodium

Hey everyone! Is there a way to get the Mojo extension in vscodium? I am not able to find it, is it by any reason only available in vscode?...

Is there any documentation for Mojo MLIR dialect(s)?

I have embarked on a perhaps foolish quest make calling into C easier by using mlir-translate to import LLVM IR (since clang isn't MLIR ready yet). This does involve a bit of -fdebug-macro as well, and converting those into constants for Mojo. While I can infer some things from error messages, proper documentation would make this much easier. The intention is to make liberal use of inline MLIR for function bodies, and then do my best to translate structs, function signatures, and constants....

MOJO for Visual Studio IDE?

Hello, I wanna start an enterprise project, and I was wondering if there's an integration to the Visual Studio ecosystem, providing anything from compiling to help in debugging, testing, and so on... So, is there any kind of integration alongside Visual Studio IDE? And not just for MOJO, but also for the entire MAX Framework....

multi-thread / async synchronization primitives?

atomics have made it to stdlib, but how about things like Mutex, RWLock, Semaphore?

Anyone here has tried using Mojo with local Whisper from OpenAI?

Hi! I'm trying to use Whisper from OpenAI locally, but python in general is pretty slow. Anyone has tried running any kind of Whisper from OpenAI locally?

SSL/TLS Support?

Is there anything planned for Mojo stdlib in terms of SSL/TLS? I'm thinking something like Golang's crypto/tls or Python's SSL socket wrapper We want to add HTTPS support to Lightbug but for that would be good to know if the stdlib will include this functionality any time soon or if this has to be built by the community...

Mojo WASM target?

I saw this Issue, but still curious if it's possible to somehow contribute to create a WASM target? Or is Mojo not open sourced enough yet? https://github.com/modularml/mojo/issues/19

Http client library

Hi, im new to mojo, its really fast, but it doesn't has many library, so i just want to ask you guys can suggest me some, many thanks!!!

Create shorter name for sturct attribute without transfering ownership

I want to do something like this
mojo_model = Model("nickypro/tinyllama-15M")
transformer_weights = mojo_model.transformer_weights^
mojo_model = Model("nickypro/tinyllama-15M")
transformer_weights = mojo_model.transformer_weights^
...

Returning references

Is it possible to return references in Mojo?

How to initialize a tensor[DType.int8] with random values of either: -1, 0, or 1?

Probably a dumb question, but how can I initialize a Tensor like so with random values of either -1, 0, or 1?
var a = Tensor[DType.int8](size)
var a = Tensor[DType.int8](size)
...

Tensor Transposition

After looking through the mojo documentation for the standard library as well as external code repositories, I was unable to find functionality to transpose 2 specified dimensions of a Tensor struct, similar to what's available in libraries such as Pytorch and Numpy. I implemented my own basic function as a brute force approach that iterates through every index, switches the specified dimensions and stores it in a separate Tensor struct. Is there any better way to go about doing this? I've been trying to look for a way to vectorize this process using SIMD as well as trying to find a way to directly mutate the tensor but can't think of any better approach. I've also tried searching for the source code that Numpy or Pytorch uses for these functions but couldn't seem to find it. My Current Approach:...