refactor(dipu): move some env vars to environs.hpp#911
Open
refactor(dipu): move some env vars to environs.hpp#911
Conversation
yewentao256
approved these changes
Jul 23, 2024
Contributor
|
需要修一下lint |
lljbash
reviewed
Jul 23, 2024
Member
lljbash
left a comment
There was a problem hiding this comment.
修改了一些文档,按照我的思路在过一下其他的,后续也一样
注意语法、简洁性和明确性,如果对作用不明确可以找人问
|
|
||
| // 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; |
Member
There was a problem hiding this comment.
Suggested change
| inline const std::size_t kDefaultMaxAsyncResourcePoolLength = 96; | |
| constexpr std::size_t kDefaultMaxAsyncResourcePoolLength = 96; |
|
|
||
| // 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); |
Member
There was a problem hiding this comment.
Suggested change
| DIPU_ENV_VAR(affinityCpuAffinit, "DIPU_CPU_AFFINITY", std::size_t, 0); | |
| DIPU_ENV_VAR(cpuAffinity, "DIPU_CPU_AFFINITY", std::size_t, 0); |
Comment on lines
+118
to
+119
| // Configure a numerical value to control the device 's affinity settings | ||
| // on the CPU to optimize thread scheduling during concurrent execution. |
Member
There was a problem hiding this comment.
Suggested change
| // 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 |
Comment on lines
+113
to
+114
| // Control whether to force the use of back-off mode for P2P copy operation | ||
| // between Ascend chips. |
Member
There was a problem hiding this comment.
Suggested change
| // 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. |
Member
There was a problem hiding this comment.
Suggested change
| // Used to specify the name of the device memory cache algorithm. | |
| // Devices' memory caching algorithm. | |
| // Candidates: TORCH, BF, BS, RAW |
Comment on lines
+90
to
+91
| // Determine the name of the host memory cache algorithm | ||
| // based on the current environment configuration. |
Member
There was a problem hiding this comment.
Suggested change
| // 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 |
Comment on lines
+99
to
+100
| // Used to configure and initialize an instance of an object | ||
| // "CachingAllocatorConfig". |
Member
There was a problem hiding this comment.
Suggested change
| // Used to configure and initialize an instance of an object | |
| // "CachingAllocatorConfig". | |
| // Same as TORCH_ALLOCATOR_CONF in PyTorch. | |
| // Only works with TORCH caching algorithm. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use macro definition to read environment variables, add comments and modify the name of environment variables.