From e1613b8cd11b1473323e2a81a3c173fb549e0bb0 Mon Sep 17 00:00:00 2001 From: CoolKbh Date: Fri, 5 Jul 2024 14:20:25 +0800 Subject: [PATCH 1/8] move envs to environ.hpp --- dipu/torch_dipu/csrc_dipu/base/environ.hpp | 4 ++++ .../runtime/core/allocator/DIPUBFCachingAllocator.cpp | 5 +++-- .../runtime/core/allocator/DIPUCachingAllocator.cpp | 6 +++--- dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp | 5 +++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/dipu/torch_dipu/csrc_dipu/base/environ.hpp b/dipu/torch_dipu/csrc_dipu/base/environ.hpp index 6b282e4b2..404e6fb07 100644 --- a/dipu/torch_dipu/csrc_dipu/base/environ.hpp +++ b/dipu/torch_dipu/csrc_dipu/base/environ.hpp @@ -91,6 +91,10 @@ DIPU_ENV_VAR(hostMemCachingAlgorithm, "DIPU_HOST_MEMCACHING_ALGORITHM", DIPU_ENV_VAR(deviceMemCachingAlgorithm, "DIPU_DEVICE_MEMCACHING_ALGORITHM", std::string, kTorchAllocatorName); DIPU_ENV_VAR(torchAllocatorConf, "DIPU_TORCH_ALLOCATOR_CONF", std::string, ""); +DIPU_ENV_VAR(maxExtendSize, "DIPU_MAX_EXTEND_SIZE", std::size_t, 1024); +inline const std::size_t kDefaultMaxAsyncResourcePoolLength = 96; +DIPU_ENV_VAR(maxAsyncResourcePoolLength, "DIPU_MAX_ASYNC_RESOURCE_POOL_LENGTH", std::size_t, kDefaultMaxAsyncResourcePoolLength); +DIPU_ENV_VAR(forceFallbackAscendP2pCopy, "DIPU_FORCE_FALLBACK_ASCEND_P2P_COPY", bool, false); #undef DIPU_ENV_VAR diff --git a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp index c7b815b5c..dcead0702 100644 --- a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp +++ b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp @@ -12,11 +12,12 @@ #include "DIPUCachingAllocator.h" #include "DIPUSpinMutex.h" +#include "csrc_dipu/base/environ.hpp" + namespace dipu { // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -const size_t kMaxExtendSize = get_env_or_default("DIPU_MAX_EXTEND_SIZE", 1024) - << 20U; +const size_t kMaxExtendSize = environ::maxExtendSize() << 20U; class BFCachingAllocatorImpl { public: diff --git a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUCachingAllocator.cpp b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUCachingAllocator.cpp index 64a927e20..505d9f767 100644 --- a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUCachingAllocator.cpp +++ b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUCachingAllocator.cpp @@ -20,15 +20,15 @@ #include "DIPUCachingDeviceAllocator.h" #include "DIPUCachingHostAllocator.h" +#include "csrc_dipu/base/environ.hpp" + namespace dipu { // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) std::mutex DIPURawDeviceAllocator::mutex_; -constexpr size_t kDefaultMaxAsyncResourcePoolLength = 96; // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -const size_t kMaxAsyncResourcePoolLength = get_env_or_default( - "DIPU_MAX_ASYNC_RESOURCE_POOL_LENGTH", kDefaultMaxAsyncResourcePoolLength); +const size_t kMaxAsyncResourcePoolLength = environ::maxAsyncResourcePoolLength(); namespace { diff --git a/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp b/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp index ad0f58bf4..99238b98d 100644 --- a/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp +++ b/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp @@ -18,6 +18,8 @@ #include "basecommimpl.hpp" +#include "csrc_dipu/base/environ.hpp" + namespace dipu { namespace devapis { @@ -30,8 +32,7 @@ using AscendDeviceId = int32_t; namespace { -const bool forceFallbackP2PCopy = - get_env_or_default("DIPU_FORCE_FALLBACK_ASCEND_P2P_COPY", false); +const bool forceFallbackP2PCopy = environ::forceFallbackAscendP2pCopy(); class NpuP2PInfo { enum class P2pStatus : int8_t { From 4f2551b02696ab76f4b42c0fcc8e1bdf22a7da3c Mon Sep 17 00:00:00 2001 From: zyf654321 Date: Tue, 23 Jul 2024 15:39:15 +0800 Subject: [PATCH 2/8] Adding annotations and renaming environment variables --- dipu/torch_dipu/csrc_dipu/base/environ.hpp | 14 +++++++++++++- .../csrc_dipu/runtime/devproxy/deviceproxy.cpp | 3 ++- .../csrc_dipu/vendor/ascend/deviceimpl.cpp | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dipu/torch_dipu/csrc_dipu/base/environ.hpp b/dipu/torch_dipu/csrc_dipu/base/environ.hpp index 404e6fb07..041557cc3 100644 --- a/dipu/torch_dipu/csrc_dipu/base/environ.hpp +++ b/dipu/torch_dipu/csrc_dipu/base/environ.hpp @@ -86,15 +86,27 @@ T getEnvOrDefault(const char* env_var, U&& default_value, // applyDelayedRegister() is called. DIPU_ENV_VAR(immediateRegisterOp, "DIPU_IMMEDIATE_REGISTER_OP", bool, false); inline const std::string kTorchAllocatorName = "TORCH"; +// Determine the name of the host memory cache algorithm +// based on the current environment configuration. DIPU_ENV_VAR(hostMemCachingAlgorithm, "DIPU_HOST_MEMCACHING_ALGORITHM", std::string, kTorchAllocatorName); +// Used to specify the name of the device memory cache algorithm. DIPU_ENV_VAR(deviceMemCachingAlgorithm, "DIPU_DEVICE_MEMCACHING_ALGORITHM", std::string, kTorchAllocatorName); +// Used to configure and initialize an instance of an object "CachingAllocatorConfig". DIPU_ENV_VAR(torchAllocatorConf, "DIPU_TORCH_ALLOCATOR_CONF", std::string, ""); +// maxExtendSize is used to limit the maximum size of an extension +// in the memory allocation in function of "extend()". DIPU_ENV_VAR(maxExtendSize, "DIPU_MAX_EXTEND_SIZE", std::size_t, 1024); +// Configure a value to limit the maximum length of the asynchronous resource pool +// to avoid resource leakage and optimize resource management. inline const std::size_t kDefaultMaxAsyncResourcePoolLength = 96; DIPU_ENV_VAR(maxAsyncResourcePoolLength, "DIPU_MAX_ASYNC_RESOURCE_POOL_LENGTH", std::size_t, kDefaultMaxAsyncResourcePoolLength); -DIPU_ENV_VAR(forceFallbackAscendP2pCopy, "DIPU_FORCE_FALLBACK_ASCEND_P2P_COPY", bool, false); +// Control whether to force the use of back-off mode for P2P copy operation between Ascend chips. +DIPU_ENV_VAR(forceFallbackP2pCopybetweenascends, "DIPU_FORCE_FALLBACK_ASCEND_P2P_COPY", bool, false); +// Configure a numerical value to control the device 's affinity settings +// on the CPU to optimize thread scheduling during concurrent execution. +DIPU_ENV_VAR(affinityCpuAffinit, "DIPU_CPU_AFFINITY", std::size_t, 0); #undef DIPU_ENV_VAR diff --git a/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp b/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp index d6bda498e..9d6c24e26 100644 --- a/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp +++ b/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp @@ -64,7 +64,8 @@ deviceId_t current_device() { } void setCpuAffinity(const int device) { - static int affinity = get_env_or_default("DIPU_CPU_AFFINITY", 0); + static int affinity = environ::affinityCpuAffinit(); + if (affinity < 0) { return; } diff --git a/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp b/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp index 99238b98d..d309eb21c 100644 --- a/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp +++ b/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp @@ -32,7 +32,7 @@ using AscendDeviceId = int32_t; namespace { -const bool forceFallbackP2PCopy = environ::forceFallbackAscendP2pCopy(); +const bool forceFallbackP2PCopy = environ::forceFallbackP2pCopybetweenascends(); class NpuP2PInfo { enum class P2pStatus : int8_t { From 3fec040eb4f0737689be259ceb88f6dce465b6bc Mon Sep 17 00:00:00 2001 From: zyf654321 Date: Tue, 23 Jul 2024 16:12:27 +0800 Subject: [PATCH 3/8] Adding annotations and renaming environment variables --- dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp b/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp index 9d6c24e26..fa5188b95 100644 --- a/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp +++ b/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp @@ -11,6 +11,7 @@ #include "csrc_dipu/runtime/device/basedef.h" #include "csrc_dipu/runtime/device/deviceapis.h" #include "csrc_dipu/utils/env.hpp" +#include "csrc_dipu/base/environ.hpp" namespace dipu { namespace devproxy { From 025405d5b6b5121e1d8f734062764418c05a899a Mon Sep 17 00:00:00 2001 From: zyf654321 Date: Tue, 23 Jul 2024 16:27:30 +0800 Subject: [PATCH 4/8] Adding annotations and renaming environment variables --- dipu/torch_dipu/csrc_dipu/base/environ.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dipu/torch_dipu/csrc_dipu/base/environ.hpp b/dipu/torch_dipu/csrc_dipu/base/environ.hpp index 041557cc3..cfe548561 100644 --- a/dipu/torch_dipu/csrc_dipu/base/environ.hpp +++ b/dipu/torch_dipu/csrc_dipu/base/environ.hpp @@ -86,24 +86,31 @@ T getEnvOrDefault(const char* env_var, U&& default_value, // applyDelayedRegister() is called. DIPU_ENV_VAR(immediateRegisterOp, "DIPU_IMMEDIATE_REGISTER_OP", bool, false); inline const std::string kTorchAllocatorName = "TORCH"; + // Determine the name of the host memory cache algorithm // based on the current environment configuration. DIPU_ENV_VAR(hostMemCachingAlgorithm, "DIPU_HOST_MEMCACHING_ALGORITHM", std::string, kTorchAllocatorName); + // Used to specify the name of the device memory cache algorithm. DIPU_ENV_VAR(deviceMemCachingAlgorithm, "DIPU_DEVICE_MEMCACHING_ALGORITHM", std::string, kTorchAllocatorName); + // Used to configure and initialize an instance of an object "CachingAllocatorConfig". DIPU_ENV_VAR(torchAllocatorConf, "DIPU_TORCH_ALLOCATOR_CONF", std::string, ""); + // maxExtendSize is used to limit the maximum size of an extension // in the memory allocation in function of "extend()". DIPU_ENV_VAR(maxExtendSize, "DIPU_MAX_EXTEND_SIZE", std::size_t, 1024); + // Configure a value to limit the maximum length of the asynchronous resource pool // to avoid resource leakage and optimize resource management. inline const std::size_t kDefaultMaxAsyncResourcePoolLength = 96; DIPU_ENV_VAR(maxAsyncResourcePoolLength, "DIPU_MAX_ASYNC_RESOURCE_POOL_LENGTH", std::size_t, kDefaultMaxAsyncResourcePoolLength); + // Control whether to force the use of back-off mode for P2P copy operation between Ascend chips. DIPU_ENV_VAR(forceFallbackP2pCopybetweenascends, "DIPU_FORCE_FALLBACK_ASCEND_P2P_COPY", bool, false); + // Configure a numerical value to control the device 's affinity settings // on the CPU to optimize thread scheduling during concurrent execution. DIPU_ENV_VAR(affinityCpuAffinit, "DIPU_CPU_AFFINITY", std::size_t, 0); From 0fb69afdfee57e428619b3e4b77085691c6f2f6b Mon Sep 17 00:00:00 2001 From: zyf654321 Date: Tue, 23 Jul 2024 17:08:30 +0800 Subject: [PATCH 5/8] Adding annotations and renaming environment variables --- dipu/torch_dipu/csrc_dipu/base/environ.hpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/dipu/torch_dipu/csrc_dipu/base/environ.hpp b/dipu/torch_dipu/csrc_dipu/base/environ.hpp index cfe548561..bb91b0a8d 100644 --- a/dipu/torch_dipu/csrc_dipu/base/environ.hpp +++ b/dipu/torch_dipu/csrc_dipu/base/environ.hpp @@ -87,7 +87,7 @@ T getEnvOrDefault(const char* env_var, U&& default_value, DIPU_ENV_VAR(immediateRegisterOp, "DIPU_IMMEDIATE_REGISTER_OP", bool, false); inline const std::string kTorchAllocatorName = "TORCH"; -// Determine the name of the host memory cache algorithm +// Determine the name of the host memory cache algorithm // based on the current environment configuration. DIPU_ENV_VAR(hostMemCachingAlgorithm, "DIPU_HOST_MEMCACHING_ALGORITHM", std::string, kTorchAllocatorName); @@ -96,22 +96,26 @@ DIPU_ENV_VAR(hostMemCachingAlgorithm, "DIPU_HOST_MEMCACHING_ALGORITHM", DIPU_ENV_VAR(deviceMemCachingAlgorithm, "DIPU_DEVICE_MEMCACHING_ALGORITHM", std::string, kTorchAllocatorName); -// Used to configure and initialize an instance of an object "CachingAllocatorConfig". +// Used to configure and initialize an instance of an object +// "CachingAllocatorConfig". DIPU_ENV_VAR(torchAllocatorConf, "DIPU_TORCH_ALLOCATOR_CONF", std::string, ""); -// maxExtendSize is used to limit the maximum size of an extension +// maxExtendSize is used to limit the maximum size of an extension // in the memory allocation in function of "extend()". DIPU_ENV_VAR(maxExtendSize, "DIPU_MAX_EXTEND_SIZE", std::size_t, 1024); -// Configure a value to limit the maximum length of the asynchronous resource pool -// to avoid resource leakage and optimize resource management. +// Configure a value to limit the maximum length of the asynchronous resource +// pool to avoid resource leakage and optimize resource management. inline const std::size_t kDefaultMaxAsyncResourcePoolLength = 96; -DIPU_ENV_VAR(maxAsyncResourcePoolLength, "DIPU_MAX_ASYNC_RESOURCE_POOL_LENGTH", std::size_t, kDefaultMaxAsyncResourcePoolLength); +DIPU_ENV_VAR(maxAsyncResourcePoolLength, "DIPU_MAX_ASYNC_RESOURCE_POOL_LENGTH", + std::size_t, kDefaultMaxAsyncResourcePoolLength); -// Control whether to force the use of back-off mode for P2P copy operation between Ascend chips. -DIPU_ENV_VAR(forceFallbackP2pCopybetweenascends, "DIPU_FORCE_FALLBACK_ASCEND_P2P_COPY", bool, false); +// Control whether to force the use of back-off mode for P2P copy operation +// between Ascend chips. +DIPU_ENV_VAR(forceFallbackP2pCopybetweenascends, + "DIPU_FORCE_FALLBACK_ASCEND_P2P_COPY", bool, false); -// Configure a numerical value to control the device 's affinity settings +// Configure a numerical value to control the device 's affinity settings // on the CPU to optimize thread scheduling during concurrent execution. DIPU_ENV_VAR(affinityCpuAffinit, "DIPU_CPU_AFFINITY", std::size_t, 0); From 55673375e3baa3123fa1dba4532396f6f911acb4 Mon Sep 17 00:00:00 2001 From: zyf654321 Date: Tue, 23 Jul 2024 17:17:40 +0800 Subject: [PATCH 6/8] Adding annotations and renaming environment variables --- .../runtime/core/allocator/DIPUBFCachingAllocator.cpp | 3 +-- .../runtime/core/allocator/DIPUCachingAllocator.cpp | 5 ++--- dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp | 2 +- dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp | 3 +-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp index c89add5fe..7b58ae227 100644 --- a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp +++ b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp @@ -7,13 +7,12 @@ #include #include +#include "csrc_dipu/base/environ.hpp" #include "csrc_dipu/utils/env.hpp" #include "DIPUCachingAllocator.h" #include "DIPUSpinMutex.h" -#include "csrc_dipu/base/environ.hpp" - namespace dipu { // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUCachingAllocator.cpp b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUCachingAllocator.cpp index 505d9f767..d94bb9feb 100644 --- a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUCachingAllocator.cpp +++ b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUCachingAllocator.cpp @@ -20,15 +20,14 @@ #include "DIPUCachingDeviceAllocator.h" #include "DIPUCachingHostAllocator.h" -#include "csrc_dipu/base/environ.hpp" - namespace dipu { // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) std::mutex DIPURawDeviceAllocator::mutex_; // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -const size_t kMaxAsyncResourcePoolLength = environ::maxAsyncResourcePoolLength(); +const size_t kMaxAsyncResourcePoolLength = + environ::maxAsyncResourcePoolLength(); namespace { diff --git a/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp b/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp index fa5188b95..c3e74c1e3 100644 --- a/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp +++ b/dipu/torch_dipu/csrc_dipu/runtime/devproxy/deviceproxy.cpp @@ -6,12 +6,12 @@ #include +#include "csrc_dipu/base/environ.hpp" #include "csrc_dipu/runtime/core/DIPUEventPool.h" #include "csrc_dipu/runtime/core/allocator/allocator_metrics.h" #include "csrc_dipu/runtime/device/basedef.h" #include "csrc_dipu/runtime/device/deviceapis.h" #include "csrc_dipu/utils/env.hpp" -#include "csrc_dipu/base/environ.hpp" namespace dipu { namespace devproxy { diff --git a/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp b/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp index d309eb21c..8deff49ef 100644 --- a/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp +++ b/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp @@ -10,6 +10,7 @@ #include #include +#include "csrc_dipu/base/environ.hpp" #include "csrc_dipu/runtime/device/basedef.h" #include "csrc_dipu/utils/env.hpp" #include @@ -18,8 +19,6 @@ #include "basecommimpl.hpp" -#include "csrc_dipu/base/environ.hpp" - namespace dipu { namespace devapis { From 5e8f2196d03fa8c3d370661af534453826ffc6ed Mon Sep 17 00:00:00 2001 From: zyf654321 Date: Tue, 23 Jul 2024 17:51:53 +0800 Subject: [PATCH 7/8] Adding annotations and renaming environment variables --- dipu/torch_dipu/csrc_dipu/base/environ.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dipu/torch_dipu/csrc_dipu/base/environ.hpp b/dipu/torch_dipu/csrc_dipu/base/environ.hpp index bb91b0a8d..e04efabd0 100644 --- a/dipu/torch_dipu/csrc_dipu/base/environ.hpp +++ b/dipu/torch_dipu/csrc_dipu/base/environ.hpp @@ -117,7 +117,7 @@ DIPU_ENV_VAR(forceFallbackP2pCopybetweenascends, // Configure a numerical value to control the device 's affinity settings // on the CPU to optimize thread scheduling during concurrent execution. -DIPU_ENV_VAR(affinityCpuAffinit, "DIPU_CPU_AFFINITY", std::size_t, 0); +DIPU_ENV_VAR(affinityCpuAffinit, "DIPU_CPU_AFFINITY", std::int, 0); #undef DIPU_ENV_VAR From 6d528b01e6312814c3c60ad161300334e1ce0417 Mon Sep 17 00:00:00 2001 From: zyf654321 Date: Tue, 23 Jul 2024 17:54:07 +0800 Subject: [PATCH 8/8] Adding annotations and renaming environment variables --- dipu/torch_dipu/csrc_dipu/base/environ.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dipu/torch_dipu/csrc_dipu/base/environ.hpp b/dipu/torch_dipu/csrc_dipu/base/environ.hpp index e04efabd0..13f52c021 100644 --- a/dipu/torch_dipu/csrc_dipu/base/environ.hpp +++ b/dipu/torch_dipu/csrc_dipu/base/environ.hpp @@ -117,7 +117,7 @@ DIPU_ENV_VAR(forceFallbackP2pCopybetweenascends, // Configure a numerical value to control the device 's affinity settings // on the CPU to optimize thread scheduling during concurrent execution. -DIPU_ENV_VAR(affinityCpuAffinit, "DIPU_CPU_AFFINITY", std::int, 0); +DIPU_ENV_VAR(affinityCpuAffinit, "DIPU_CPU_AFFINITY", int, 0); #undef DIPU_ENV_VAR