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

What github actions are folks using for CI?

I imagine an official mojo package workflow will emerge once packaging is reasonably settled. In the meantime, how do you all run tests, generate docs, etc. with github actions?

UnsafePointer & Structs

would anyone be able to help me understand what is happening here? why are the outputs of the two print statements different? ``` @value struct Test: ...

Fixed Point

Does mojo float point support fixed point to be sure cross platform have all the same float number?

crypto lib

is there a crypto library for mojo with an implementation of AES

MAX on Arch Linux?

I just wanted to know an official Arch Linux package was anywhere on the horizon. Seems like a no-brainer to add official support for the Arch family of distros. I am excited by the promise of Mojo and MAX, and I would like to explore it further, but I'll die before I install Debian again.
No description

Does Mojo have inline assembly?

Does Mojo currently have a blessed way to do inline assembly? LLVM doesn't have intrinsics for ARM MSR reads, and the two best clocks on an ARM system from a microbenchmark perspective are cntvct_el0 and pmccntr_el0, both of which are MSRs. In C I would normally read them as follows: ```c uint64_t tsc; ...

Would you be interested in BigInt support?

I did some programming exercises in Mojo and noticed that BigInt support is missing, and Mojo should probably support BigInt at some point, seeing as Python uses arbitrary precision integers by default. Are there any other users missing this? Would it make sense for me to start working on this as a Mojo stdlib PR or is this the sort of thing Mojo would rather have as a 3rd party library for now?...

I do not know why the output is like this!

I ran two almost identical programmes but the output changed. But I don't understand why the output changes. I would like to know. First Program ```def greet(name: String):...

mojo windows

When will mojo for windows be released

Iterating over unknown sizes

Mojo iterators use the size and not an exception to indicate the end of an iterator. Is it still somehow possible to iterate over collections that don't have an upfront known size (like streams of data) ?...

Mojo nightly auth

Hi! Why does installing nightly/mojo requires authentication while installing the stable does not? I would like to have a nightly mojo container but it complicates the build.

Any Plans for SPIR-V/OpenCL Support?

Are there any plans for a SPIR-V target for Mojo or an OpenCL backend for Max? It would be useful since it would allow leveraging OpenCL compatible hardware instead of whatever Modular can specifically add support for, in particular FPGAs are very good at inference on small models on price/perf when looking at major cloud providers.

Regular packages for Linux and installation without login

It's almost impossible to log in and install mojo in China and Slavic countries without perfectly configurated proxy. It's OK if you would need to login to install and use a proprietary stuff but why we need log in to use Open Source project? Mojo would be much more popular if it was distributed like a normal package without login

How to get a string out of an __mlir_type.i256 ?

Using the llvm dialect, I can add numbers of any size, In this picture I add 256 bit numbers. This compiled and ran, which is wonderful, but now I don't know how to get a string out of var c so I can see the result. In stdlib, the way to print a scalar is so convoluted and complex that I was not able to understand it. If someone knows how to do it using simple MLIR operations, it could benefit anyone trying to create a custom mojo type using MLIR. ...
No description