-
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?
Conversation
需要修一下lint |
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.
修改了一些文档,按照我的思路在过一下其他的,后续也一样
注意语法、简洁性和明确性,如果对作用不明确可以找人问
|
||
// 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 comment
The reason will be displayed to describe this comment to others. Learn more.
inline const std::size_t kDefaultMaxAsyncResourcePoolLength = 96; | |
constexpr std::size_t kDefaultMaxAsyncResourcePoolLength = 96; |
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.
有些地方定义了常量,有些地方直接写了默认值,建议统一起来
|
||
// 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); |
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.
DIPU_ENV_VAR(affinityCpuAffinit, "DIPU_CPU_AFFINITY", std::size_t, 0); | |
DIPU_ENV_VAR(cpuAffinity, "DIPU_CPU_AFFINITY", std::size_t, 0); |
// Configure a numerical value to control the device 's affinity settings | ||
// on the CPU to optimize thread scheduling during concurrent execution. |
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.
// Configure a numerical value to control the device 's affinity settings | |
// on the CPU to optimize thread scheduling during concurrent execution. | |
// Devices' CPU affinity settings. | |
// >0: specifies the number of adjacent CPU cores bound to each device | |
// =0: auto determine | |
// <0: affinity disabled |
// Control whether to force the use of back-off mode for P2P copy operation | ||
// between Ascend chips. |
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.
// Control whether to force the use of back-off mode for P2P copy operation | |
// between Ascend chips. | |
// Whether to force the use of back-off mode for P2P copy operation between | |
// Ascend chips. |
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 comment
The reason will be displayed to describe this comment to others. Learn more.
// Used to specify the name of the device memory cache algorithm. | |
// Devices' memory caching algorithm. | |
// Candidates: TORCH, BF, BS, RAW |
// Determine the name of the host memory cache algorithm | ||
// based on the current environment configuration. |
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.
// Determine the name of the host memory cache algorithm | |
// based on the current environment configuration. | |
// Host's memory caching algorithm. | |
// Candidates: TORCH, BF, BS, RAW |
// Used to configure and initialize an instance of an object | ||
// "CachingAllocatorConfig". |
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.
// Used to configure and initialize an instance of an object | |
// "CachingAllocatorConfig". | |
// Same as TORCH_ALLOCATOR_CONF in PyTorch. | |
// Only works with TORCH caching algorithm. |
Use macro definition to read environment variables, add comments and modify the name of environment variables.