Mojo combines the usability of Python with the performance of C, unlocking unparalleled programmability of AI hardware and extensibility of AI models.
目标是为 AI 开发服务,组合 python 的工具优势和 C 的性能,代码风格很点像 python:
def softmax(lst):
norm = np.exp(lst - np.max(lst))
return norm / norm.sum()
struct NDArray:
def max(self) -> NDArray:
return self.pmap(SIMD.max)
struct SIMD[type: DType, width: Int]:
def max(self, rhs: Self) -> Self:
return (self >= rhs).select(self, rhs)
link: https://www.modular.com/mojo
训练框架据说性能提升很多倍,先踩个点围观