Overview

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

×

Atlas inference products

×

Atlas training products

Description

Returns a global singleton configuration object for initializing an NPU device. By modifying the parameters of the global singleton object, you can control the initialization options of the NPU device. This API must be called before the npu.open API call.

This section describes the global singleton configuration provided by the NPU.

Prototype

npu.global_options()

Example

Set the global configuration options before initializing the NPU. The following is a call example of changing the precision mode from allow_fp32_to_fp16 to allow_mix_precision:

1
2
3
import npu_device as npu
npu.global_options().precision_mode = 'allow_mix_precision'
npu.open().as_default()