-
Notifications
You must be signed in to change notification settings - Fork 83
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
doc: update env.py api documentation #15
Changes from all commits
346ed99
719d61b
a9252bc
fac8788
08a05e9
84fc927
a98d3ac
c464217
ec05e0b
ac30a55
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 |
---|---|---|
|
@@ -3,62 +3,73 @@ | |
|
||
def get_world_size(): | ||
""" | ||
Returns the number of processes in the current process group | ||
Get the number of processes in the current process group. | ||
|
||
Returns: | ||
The world size of the process group | ||
|
||
The world size of the process group. | ||
""" | ||
return int(os.environ.get("WORLD_SIZE", 1)) | ||
|
||
|
||
def get_rank(): | ||
""" | ||
Returns the rank of current process group | ||
Get the rank of current process group. | ||
|
||
Rank is a unique identifier assigned to each process within a distributed | ||
process group. They are always consecutive integers ranging from 0 to | ||
``world_size``. | ||
|
||
Returns: | ||
The rank of the process group | ||
|
||
The rank of the process group. | ||
""" | ||
return int(os.environ.get("RANK", 0)) | ||
|
||
|
||
def get_local_rank(): | ||
""" | ||
Returns the rank of current node | ||
Get the rank of current node. | ||
|
||
Rank is a unique identifier assigned to each process within a node. | ||
Local rank is a unique identifier assigned to each process within a node. | ||
They are always consecutive integers ranging from 0 to ``local_size``. | ||
|
||
Returns: | ||
The local rank of the node | ||
|
||
The local rank of the node. | ||
""" | ||
return int(os.environ.get("LOCAL_RANK", 0)) | ||
|
||
|
||
def get_local_size(): | ||
""" | ||
Returns the number of processes in the node | ||
Get the number of processes in the node. | ||
|
||
Returns: | ||
The local size of the node | ||
|
||
The local size of the node. | ||
""" | ||
return int(os.environ.get("LOCAL_SIZE", 1)) | ||
|
||
|
||
def get_autotune_server_addr(): | ||
""" | ||
Get autotune server addr. | ||
|
||
Returns: | ||
The ip address of autotune server. | ||
""" | ||
return os.environ.get("AUTO_TUNE_SERVER_ADDR") | ||
|
||
|
||
def is_report_metrics_switch_on(): | ||
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. Same like get_autotune_server_addr 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. this function has been hidden |
||
""" | ||
Whether bagua report switch is on or not. | ||
""" | ||
return int(os.environ.get("BAGUA_REPORT_METRICS", 0)) == 1 | ||
|
||
|
||
def get_autotune_level(): | ||
""" | ||
Get the atuotune level. | ||
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. Need to explain, or give a ref link to autotune api doc to let the readers know what this is about. 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. Same like above. I am going to introduce the use of autotune in the tutorial 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. this function has been hidden |
||
|
||
Returns: | ||
The autotune level. | ||
""" | ||
return int(os.environ.get("BAGUA_AUTOTUNE", 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.
Inner interface, users DO NOT need to know.
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.
this function has been hidden