-
Notifications
You must be signed in to change notification settings - Fork 8
Improve code documentation and APIs #49
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
Conversation
Why do we have to describe it as local/remote only? If we use |
Correct. It is confusing and I would like to resolve that. Do you have suggestions? I have a few: # 1. Emphasizes direction of data flow
def load(pointer, to_rank, from_rank, heap_bases, mask=None):
# 2. Uses 'cur' to indicate the calling rank
def load(pointer, cur_rank, dst_rank, heap_bases, mask=None):
# 3. Generalizes roles as caller/target
def load(pointer, caller_rank, target_rank, heap_bases, mask=None): The pointer argument can be named I do like the from/to at the moment. Here are all APIs: def load(pointer, to_rank, from_rank, heap_bases, mask=None):
def store(pointer, val, from_rank, to_rank, heap_bases, mask=None):
def get(from_pointer, to_pointer, to_rank, from_rank, heap_bases, mask=None):
def put(from_pointer, to_pointer, from_rank, to_rank, heap_bases, mask=None):
def atomic_add(pointer, val, from_rank, to_rank, heap_bases, mask=None, sem=None, scope=None):
def atomic_sub(pointer, val, from_rank, to_rank, heap_bases, mask=None, sem=None, scope=None):
def atomic_cas(pointer, cmp, val, from_rank, to_rank, heap_bases, sem=None, scope=None):
def atomic_xchg(pointer, val, from_rank, to_rank, heap_bases, mask=None, sem=None, scope=None): |
Notes
Other suggestions:
def get(from_pointer, to_pointer, to_rank, from_rank, heap_bases, mask=None):
def put(from_pointer, to_pointer, from_rank, to_rank, heap_bases, mask=None): |
No. For that reason, I was considering adding a text to warn against that e.g., for load " The shortened How about this: def load(pointer, to_rank, from_rank, heap_bases, mask=None):
def store(pointer, val, from_rank, to_rank, heap_bases, mask=None):
def atomic_add(pointer, val, from_rank, to_rank, heap_bases, mask=None, sem=None, scope=None):
def atomic_sub(pointer, val, from_rank, to_rank, heap_bases, mask=None, sem=None, scope=None):
def atomic_cas(pointer, cmp, val, from_rank, to_rank, heap_bases, sem=None, scope=None):
def atomic_xchg(pointer, val, from_rank, to_rank, heap_bases, mask=None, sem=None, scope=None): and, def get(dst_ptr, src_ptr, to_rank, from_rank, heap_bases, mask=None):
def put(dst_ptr, src_ptr, to_rank, from_rank, heap_bases, mask=None): |
I am not sure I understand the warning. You mean
I prefer spelled out as well --- triton is not consistent with their naming, you can easily find examples of these. I like this! (with |
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.
Still lots of remote
, lets discuss the best way to word some of the descriptions.
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.
Looks good to me!
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.
Pull Request Overview
This PR improves the documentation and API design of the iris library by making the translate
function private and enhancing docstrings for memory operations. The changes focus on clarifying parameter naming conventions and providing more detailed documentation for cross-rank memory operations.
Key changes:
- Made the
translate
function private by renaming it to__translate
and removing it from public exports - Improved parameter naming conventions across all memory operation functions (e.g.,
cur_rank
→from_rank
,target_rank
→to_rank
) - Enhanced docstrings with detailed explanations of memory translation operations and parameter descriptions
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
File | Description |
---|---|
iris/iris.py | Renamed translate to __translate , improved parameter naming, and added comprehensive docstrings for all memory operation functions |
iris/init.py | Removed translate from public exports and fixed trailing comma in __all__ list |
@mawad-amd I just asked copilot to see if it catches something I missed, feel free to ignore that. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
I think the language is still a bit confusing. I am not happy with the text now but will revisit later. |
First attempt at improving docs. local/remote is still a bit confusing.
Closes #46