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

How are Integers implemented in Mojo?

I experiment with lists of integers in python and mojo and noticed that mojo is way more memory efficient. Is this all done thanks to the static typing or are there other Optimistin methods in play?...

What is the difference between fn(inout v: T) and fn(ref v: T) ?

Both work the same if the Origin is inferred for ref? What are the differences?

Modular on Bluesky

There has been a surge of new users on Bluesky, are Modular considering having a presence there?

Exploring Mojo for Real-Time AI Voice Call Solutions

Dear Mojo Community, I hope you’re all doing well! My name is Juan Manuel Castaño, and I’ve recently started exploring Mojo programming language, captivated by its potential for high-performance computing. I’m working on a project that involves building an AI-driven solution for real-time voice calls. Given the critical need for low latency and high-speed thread connections in this setup, I’m curious to learn if Mojo could help optimize this process. Specifically, I’d like to know if Mojo is suitable for enhancing the speed and efficiency of thread management in such a real-time environment....

is there a way I can convert a list to a SIMD vector?

can someone tell me how I can convert a list to a SIMD vector

Vale Status

Full disclosure, this is a little off topic and is only tangentially related to Mojo. There was a nascent language I was following a little while ago called Vale, trying to revolutionize memory management using generational references. It's GitHub hadn't had a commit in a while, so I figured it was a dead project and forgot about it. As fate would have it, Evan Ovadia (the speaker at the most recent Mojo community meeting), turns out to be the creator of Vale. Is anyone aware of whether he's still working on Vale or if he's since decided to go all in on Mojo?...

Clarification on the Meaning of Python Superset

This question references this commit: https://github.com/modularml/mojo/commit/cb307d0f57bb07b37528e8f6e2c859a1e07db941 It remove all references to Mojo being a "superset of python" and changed the language to sate that Mojo is "the best way to extent python". Has Modular officially conifrmed that Mojo will not be a superset of Python?...

Has anyone tried to get an LLM to code in Mojo, or convert Python into Mojo?

This is one of those small thoughts that makes me think a little about adoption and use, since Mojo should be fast and people already love to harp on Rust and Go, but interop with Python is real nice, and a lot of people use Python.

Parallelize Issue

This is my code: ``` alias NTHREADS = 4 fn xyz(A: UnsafePointer[Float32], B: UnsafePointer[Float32], nc:Int):...

Install Mojo/Magic

Is it Magic using or installing CONDA at any time to install Mojo?

Will Mojo ever become fully free and open source?

Mojo is such a fine language. I fell in love with it the moment I used it. But such a shame that most people are hesitant to adopt due to the fears of vendor lock in. Especially hesitant to build any enterprise grade products/solutions in the future using this due to current terms of license/usage. On the other hand, there are statements made by Modular that it would be made open source progressively. To increase the adoptability and usage, wouldn’t it be a good idea to separate Max & Mojo, and keep Mojo fully free without any conditions (even if you keep the source closed for quite sometime for focussed development), but keep the Max & Mojo support chargeable? This dependency on Max to use Mojo, and with all those terms listed in the license agreement make many really apprehensive about coming ahead to learn, contribute (and adopt eventually) to such a wonderful programming language....

Struct containing a list of itself?

Hi, I'm trying to creating a node-like tree which can contain a child (or children), but the mojo compiler doesn't really let me do that: ```rust @value struct Node: var value: Int...

Compile time facilities

I am trying to write a function that compares a SIMD variable against a a sequence of other SIMD vectors that are determined by a function parameter and I want the function to do as much as possible at compile time. Ideally so that at runtime the function just has a structure like ``` If variable == reference1: return True...

Can I port my Python lib to Mojo?

I am developing a torch-based AI lib. I want to make it faster (specially the non-torch parts). Can I do a full port to Mojo amd expect it to work on Python AND Mojo?

State of Mojo on WASM?

What are the plans for porting Mojo to WASM? When can we expect it? Wanna make a Mojo based Framework for making Webapps which targets WASM....

Most efficient way to check for tictactoe board win

I want to write a litle tictactoe game (with arbitrary board size) in Mojo and was thinking how to go the hardest on optimizing it (just for fun). I was thinking of using a SIMD to hold the board where 0 is empty, 1 is player X and 2 is player O. Then i can check for a full board like: ```...

Error running https://builds.modular.com/builds/llama3/python example

Hi I am trying out one of the examples per https://builds.modular.com/builds/llama3/python. I followed all the instructions on the page and in addition after CD ing into the pipelines/python folder I ran the "magic shell" to activate the environment. However I am stuck with the following error: None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used. ... ValueError: cannot reshape array of size 12679776 into shape (4096,11760)...

TorchInputSpec

@kapa.ai where can i find TorchInputSpec

anyone know why I might be this error about TorchInputSpec:

use of unknown declaration 'TorchInputSpec'mojo from: var session = engine.InferenceSession() var model = session.load( model_path, input_specs = [...
Next