MCPcopy Create free account
hub / github.com/ml-explore/mlx / to_fp8

Function to_fp8

mlx/ops.cpp:5252–5264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5250}
5251
5252array to_fp8(array x, StreamOrDevice s) {
5253 if (!issubdtype(x.dtype(), floating)) {
5254 std::ostringstream msg;
5255 msg << "[to_fp8] Only real floating types are supported but "
5256 << "x.dtype() == " << x.dtype() << ".";
5257 throw std::invalid_argument(msg.str());
5258 }
5259 return array(
5260 x.shape(),
5261 uint8,
5262 std::make_shared<fast::ConvertFP8>(to_stream(s), true),
5263 {x});
5264}
5265
5266array gather_qmm(
5267 const array& x,

Callers 2

fp_quantizeFunction · 0.85
ops_tests.cppFile · 0.85

Calls 3

issubdtypeFunction · 0.85
to_streamFunction · 0.85
arrayFunction · 0.70

Tested by

no test coverage detected