mlx/benchmarks/python/comparative
Nicholas Santavas f5df47ec6e
Add Step, ELU, SELU, Swish activation functions (#117)
* Add Step, ELU, SELU, Swish activation functions

This commit adds the Step, ELU, SELU and Swish activations functions

* add to the docs

* review
2023-12-11 17:04:07 -08:00
..
bench_mlx.py Add Step, ELU, SELU, Swish activation functions (#117) 2023-12-11 17:04:07 -08:00
bench_torch.py Add Step, ELU, SELU, Swish activation functions (#117) 2023-12-11 17:04:07 -08:00
compare.py Add Step, ELU, SELU, Swish activation functions (#117) 2023-12-11 17:04:07 -08:00
README.md awni's commit files 2023-11-29 10:30:41 -08:00

Microbenchmarks comparing MLX to PyTorch

Implement the same microbenchmarks in MLX and PyTorch to compare and make a list of the biggest possible performance improvements and/or regressions.

Run with python bench_mlx.py sum_axis --size 8x1024x128 --axis 2 --cpu for instance to measure the times it takes to sum across the 3rd axis of the above tensor on the cpu.

compare.py runs several benchmarks and compares the speed-up or lack thereof in comparison to PyTorch.

Each bench script can be run with --print-pid to print the PID and wait for a key in order to ease attaching a debugger.