FilesLast commitLast update
12 days ago
2 months ago
12 days ago
12 days ago
12 days ago
12 days ago
12 days ago
12 days ago
12 days ago
README

NPUAllocFloatStatus

English | 简体中文

Applicable Products

Product Support
Ascend 950PR&950DT products √
Atlas A3 products √
Atlas A2 products √
Atlas 200I/500 A2 inference products √
Atlas inference products √
Atlas training products √

Function

  • Operator function: Allocates a tensor of 8 float32 zero values, which is used for NPU overflow status detection. This operator has no input, and the output is an all-zero float32 tensor with the fixed shape (8,). It is commonly used in the loss scaling overflow status allocation scenario in mixed-precision training.
  • Formula:

    output=zeros(8,dtype=float32)\text{output} = \text{zeros}(8, \text{dtype}=\text{float32})

  • Example:

    Output data:
    tensor([0., 0., 0., 0., 0., 0., 0., 0.], dtype=torch.float32)
    

Parameters

Parameter name Input/Output/Attribute Description Data type Data format
data Output NPU float status tensor, with the fixed shape (8,) and containing 8 float32 zero values, used for overflow status detection. FLOAT ND

Constraints

  • The shape of the output data is fixed to (8,) and cannot be changed. The 8 elements correspond to the overflow status flags of the NPU hardware (32 bytes in total).
  • The dtype of the output data supports only float32. Other data types are not supported.
  • The output values are always all zeros (8 float32 zero values) and do not depend on any input.
  • This operator is a deterministic operator. The output is fixed all zeros, with no parallel reduction, so it is deterministic by nature.

Invocation Description

Invocation method Invocation sample Description
Graph-mode invocation test_geir_npu_alloc_float_status Calls the NPUAllocFloatStatus operator through graph construction with the operator IR.