ExperimentalConfig Constructor
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
☓ |
|
☓ |
|
√ |
Function Description
Constructs an object of the ExperimentalConfig class. This constructor is an extended option for debugging and may be changed in later versions. Therefore, it cannot be used in commercial products.
Function Prototype
1 2 3 4 5 | class ExperimentalConfig(): def __init__(self, graph_compiler_cache_dir=None, ... ) |
Parameters
Option |
Input/Output |
Description |
|---|---|---|
graph_compiler_cache_dir |
Input |
Drive cache directory for graph compilation. If this parameter is not empty, the drive cache function for graph compilation takes effect. The graph compilation cache function supports drive persistence of graph compilation results. When graph compilation is performed again, the compilation results cached on the drive can be directly loaded to reduce the graph compilation duration. Note:
Example: graph_compiler_cache_dir="/root/build_cache_dir" |
accelerate_train_mode |
Input |
If training takes more than one hour, you can trigger training acceleration to improve training performance by configuring this option. Based on the configured acceleration type, acceleration trigger mode, and the proportion of low-precision training processes, the software compiles and runs the corresponding proportion of training processes with reduced precision, while the remaining processes are compiled and run at their original precision. The value of this option is a string with three fields separated by vertical bars (|), for example, fast|step|0.9.
Example:
NOTE
|
Returns
An object of the ExperimentalConfig class, as an argument passed to the NPURunConfig call.
Constraints
None
Example
1 2 3 4 5 6 | from npu_bridge.npu_init import * from npu_bridge.estimator.npu.npu_config import ExperimentalConfig ... experimental_config=ExperimentalConfig(accelerate_train_mode="fast|step|0.9") session_config=tf.ConfigProto(allow_soft_placement=True) config = NPURunConfig(experimental_config=experimental_config, session_config=session_config) |