taalhaataahir01022001
MModular
•Created by TomLucidor on 11/15/2024 in #questions
Has anyone tried to get an LLM to code in Mojo, or convert Python into Mojo?
https://github.com/tairov/llama2.mojo
There are also few examples on modular github repo via MAX:
https://github.com/modularml/max/tree/main/examples
3 replies
MModular
•Created by taalhaataahir01022001 on 10/8/2024 in #questions
Reshape MAX API OP giving error
And it's not the case with reshape only.
e.g., this program uses split op:
And this is the output log:
It is also extracting the wrong first 2 outputs in row 1.
4 replies
MModular
•Created by taalhaataahir01022001 on 10/8/2024 in #questions
Reshape MAX API OP giving error
Sorry my bad!! Didn't make the correct imports
Also I'm facing some issues with the code. ops.reshapes is showing unexpected behaviour. Here's my code:
Output:
t:
Tensor([[[1.2788280248641968, -1.2873831987380981],
[-0.56482106447219849, 1.5331770181655884]]], dtype=float32, shape=1x2x2)
output:
Tensor([[0.0, 0.0],
[-0.56482106447219849, 1.5331770181655884]], dtype=float32, shape=2x2)
But if I add the following code at the end of my code:
The output becomes correct:
t:
Tensor([[[1.2788280248641968, -1.2873831987380981],
[-0.56482106447219849, 1.5331770181655884]]], dtype=float32, shape=1x2x2)
output:
Tensor([[1.2788280248641968, -1.2873831987380981],
[-0.56482106447219849, 1.5331770181655884]], dtype=float32, shape=2x2)
t.reshape((2,2)):
Tensor([[1.2788280248641968, -1.2873831987380981],
[-0.56482106447219849, 1.5331770181655884]], dtype=float32, shape=2x2)
4 replies
MModular
•Created by taalhaataahir01022001 on 8/29/2024 in #questions
Dynamic Shapes to MAX GRAPH API
Now getting same error issue with Layer norm i.e.,
gives error
Unhandled exception caught during execution: Unsupported dim type: symbolic expression
Previously it was working fine!!
3 replies
MModular
•Created by JulianJS on 7/22/2024 in #questions
Matrix Multiplication (matmul): `numpy` hard to beat? even by mojo?
https://www.linkedin.com/posts/pavanmv_benchmarking-mojo-the-supercharged-superset-activity-7220047088577888256-siYI/
You can use MAX Engine for speedy matmul.
There's a whole discussing here as well:
https://github.com/modularml/mojo/issues/2660
4 replies
MModular
•Created by taalhaataahir01022001 on 6/4/2024 in #questions
Time taken in Inference session
I'm new and sorry for asking such basic questions.
1. I am compiling my code using mojo i.e., and then running the executable. Does this mean that the compilation of the graph using the MAX Engine compiler occurs at runtime and that optimizations on the graph are also performed during runtime?
2. During execution, does the Mojo compiler invoke the MAX Engine compiler to compile and optimize the graph?
3. I have written my entire model in Mojo. Now, I am planning to break down my model into custom operations in MAX Graph. Will this provide performance benefits since the MAX Engine compiler might further optimize my custom operations written in Mojo?
4 replies
MModular
•Created by taalhaataahir01022001 on 5/21/2024 in #questions
x86 Intrinsics
Thanks working now
5 replies
MModular
•Created by taalhaataahir01022001 on 3/12/2024 in #questions
GRAPH API MOTensor not working
got it!
never imported it 😛
2 replies
MModular
•Created by taalhaataahir01022001 on 1/14/2024 in #questions
Create 1D array of objects
Plus it is not only the case when I update the Dynamic Vector of objects but it also creates new objects using the copy constructor even if I try to access any specific index. e.g.,
or also invokes the copy constructors.
And it has nothing to do with weather the vector is passed to a function via reference or not. Even If I access the vector of objects in the same scope where it's created, copy constructor is called.
I tried to compare it with the C++ vectors to see if Dynamic Vectors are equivalent to vectors in C++:
Both printf("%d\n", myObjects[0].getData()) and printData function doesnot invoke any constructor which makes sense.
17 replies
MModular
•Created by taalhaataahir01022001 on 1/14/2024 in #questions
Create 1D array of objects
And you can download it using apt install perf. Maybe you might need 1-2 more dependencies which can easily be found on web
17 replies
MModular
•Created by taalhaataahir01022001 on 1/14/2024 in #questions
Create 1D array of objects
There's a tool named perf
It's pretty easy to use.
just do
And it records the time taken inside each function.
To view the output as shown above in the ss:
17 replies
MModular
•Created by taalhaataahir01022001 on 1/14/2024 in #questions
Create 1D array of objects
17 replies
MModular
•Created by taalhaataahir01022001 on 1/14/2024 in #questions
Create 1D array of objects
sure thanks
17 replies
MModular
•Created by taalhaataahir01022001 on 1/14/2024 in #questions
Create 1D array of objects
17 replies
MModular
•Created by taalhaataahir01022001 on 1/14/2024 in #questions
Create 1D array of objects
Although the DynamicVector "c" is updated outside the "newfunc2" but why is it the case that new "HuffmanEntry" object is being created while updating the "sz" argument of the object which is already stored in vector c? And How to avoid this i.e., update the object store within the dynamic vector instead of creating a new object?
17 replies
MModular
•Created by taalhaataahir01022001 on 1/14/2024 in #questions
Create 1D array of objects
@sora I was using Dynamic Vectors previously but I was getting this issue. Here I've created an example code:
In the above code, the copyinit function is called 6 times. 3 times when I use the append function (which is completely fine).
But when I send the DynamicVector "c" ti the nxt function i.e., newfunc2 and update the member variable "sz" , the copy constructor is called again. Why is it the case. According to my understanding when you use "in out" with the argument, the original object is sent to the function as a reference and not the copy of that object.
17 replies
MModular
•Created by taalhaataahir01022001 on 1/14/2024 in #questions
Create 1D array of objects
17 replies
MModular
•Created by taalhaataahir01022001 on 1/6/2024 in #questions
convert UInt8 to UInt16
Thank you soo much 🙂
3 replies
MModular
•Created by taalhaataahir01022001 on 1/5/2024 in #questions
How to convert a byte to integer?
Thanks! it helps
4 replies
MModular
•Created by taalhaataahir01022001 on 1/5/2024 in #questions
How to convert a byte to integer?
4 replies