v24.4 (2024-06-07)
π₯ Legendaryβ
-
MAX is now available on macOS! Try it now.
-
New quantization APIs for MAX Graph. You can now build high-performance graphs in Mojo that use the latest quantization techniques, enabling even faster performance and more system compatibility for large models.
Learn more in the guide to quantize your graph weights.
βοΈ Newβ
MAX Mojo APIsβ
-
Added AI pipeline examples in the
maxrepo, with Mojo implementations for common transformer layers, including quantization support.-
New Llama3 pipeline built with MAX Graph.
-
New Replit Code pipeline built with MAX Graph.
-
New TinyStories pipeline (based on TinyLlama) that offers a simple demo of the MAX Graph quantization API.
-
-
Added
max.graph.checkpointpackage to save and load model weights.All weights are stored in a
TensorDict. You can save and load aTensorDictto disk withsave()andload()functions. -
Added MAX Graph quantization APIs:
- Added quantization encodings
BFloat16Encoding,Q4_0Encoding,Q4_KEncoding, andQ6_KEncoding. - Added the
QuantizationEncodingtrait so you can build custom quantization encodings. - Added
Graph.quantize()to create a quantized tensor node. - Added
qmatmul()to perform matrix-multiplication with a float32 and a quantized matrix.
- Added quantization encodings
-
Added some MAX Graph ops:
avg_pool()max_pool()conv2d()conv3d()layer_norm()tile()select()
-
Added a
layer()context manager andcurrent_layer()function to aid in debugging during graph construction. For example:with graph.layer("foo"): with graph.layer("bar"): print(graph.current_layer()) # prints "foo.bar" x = graph.constant[DType.int64](1) graph.output(x)This adds a path
foo.barto the added nodes, which will be reported during errors. -
Added
format_system_stack()function to format the stack trace, which we use to print better error messages fromerror(). -
Added
TensorMap.keys()to get all the tensor key names.
MAX C APIβ
Miscellaneous new APIs:
M_cloneCompileConfig()M_copyAsyncTensorMap()M_tensorMapKeys()andM_deleteTensorMapKeys()M_setTorchLibraries()
π¦ Changedβ
MAX Mojo APIβ
-
EngineNumpyView.data()andEngineTensorView.data()functions that return a type-erased pointer were renamed tounsafe_ptr(). -
TensorMapnow conforms toCollectionElementtrait to be copyable and movable. -
custom_nv()was removed, and its functionality moved intocustom()as a function overload, so it can now output a list of tensor symbols.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!