create_mxfp8_scale#

nvmath.linalg.advanced.helpers.matmul.create_mxfp8_scale(x, exponent, stream=None)[source]#

Create MXFP8 block scale with the same value for the whole tensor x.

Parameters:
  • x – The tensor to create the block scale for

  • exponent – An integer from [-127, 128] range. Effective scale will be 2^exponent.

  • stream – Optional stream to create the block scale on. Defaults to the stream of x.

Returns:

An MXFP8 block scale factors tensor to be used with MXFP8 computations.