-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(dipu): move some env vars to environs.hpp #911
base: main
Are you sure you want to change the base?
Changes from all commits
e1613b8
85c7994
4f2551b
3fec040
025405d
0fb69af
5567337
5e8f219
6d528b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -86,12 +86,39 @@ 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. | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
DIPU_ENV_VAR(deviceMemCachingAlgorithm, "DIPU_DEVICE_MEMCACHING_ALGORITHM", | ||||||||||||||
std::string, kTorchAllocatorName); | ||||||||||||||
|
||||||||||||||
// Used to configure and initialize an instance of an object | ||||||||||||||
// "CachingAllocatorConfig". | ||||||||||||||
Comment on lines
+99
to
+100
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
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; | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 有些地方定义了常量,有些地方直接写了默认值,建议统一起来 |
||||||||||||||
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. | ||||||||||||||
Comment on lines
+113
to
+114
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
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. | ||||||||||||||
Comment on lines
+118
to
+119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
DIPU_ENV_VAR(affinityCpuAffinit, "DIPU_CPU_AFFINITY", int, 0); | ||||||||||||||
|
||||||||||||||
#undef DIPU_ENV_VAR | ||||||||||||||
|
||||||||||||||
} // namespace dipu::environ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.