Modular

M

Modular

Join the community to ask questions about Modular and get answers from other members.

Join

questions

community-showcase

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:...

SNPE in Mojo

I know Qualcomm has SNPE for sending PyTorch models to it and it will determine where on the snapdragon to in your model. Is there anything like this in Mojo?

Torch model is dynamic but does not have input specs set! Please set input specs before

example link https://docs.modular.com/max/python/get-started Throwing this error post compile even after specifying the imputs acording to the tutorial...

Determine Pointer Location

Hey everyone :) Got stuck on an issue and was wondering if anyone knew how to implement a kind of function to check if a pointer is allocated on the stack or the heap, i.e. ```rust...
Next