Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 4, 2025

  • Updated all Triton API docstring examples to show cross-GPU operations
  • Added comprehensive examples for all remaining methods
  • Reverted previous sync commit as requested
  • Merged main branch with PyTorch distributed changes
  • Resolved merge conflict in barrier() method docstring

Key Changes

Triton Device Functions - All examples now demonstrate cross-GPU operations:

  • load(), store(), get(), put() - Remote memory access operations between different ranks
  • atomic_add(), atomic_sub(), atomic_cas(), atomic_xchg() - Cross-GPU atomic operations
  • atomic_xor(), atomic_and(), atomic_or(), atomic_min(), atomic_max() - Additional atomic operations

Host API Methods - Comprehensive examples added for 44 methods:

  • Tensor creation methods: zeros(), ones(), full(), randn(), etc.
  • Utility methods: get_heap_bases(), barrier(), get_device(), etc.
  • Logging methods: debug(), info(), warning(), error()

Recent Updates:

  • Successfully merged main branch to include PyTorch distributed backend changes
  • Resolved merge conflict in barrier() method to use updated terminology while preserving examples
  • All examples demonstrate realistic cross-GPU communication patterns with descriptive comments

Example Format:

@triton.jit  
def kernel(ptr, heap_bases):
    # Load data from rank 1's memory into the current rank
    cur_rank = 0      # Current rank
    remote_rank = 1   # Remote rank to load from
    data = iris.load(ptr, cur_rank, remote_rank, heap_bases)

All docstring examples are syntactically correct, pass linting, and demonstrate realistic multi-GPU distributed computing scenarios compatible with the new PyTorch distributed backend.

Fixes #150.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@github-actions github-actions bot added in-progress We are working on it iris Iris project issue labels Sep 4, 2025
@Copilot Copilot AI changed the title [WIP] [Documentation]: Add examples to all doc strings [Documentation]: Add examples to all API docstrings Sep 4, 2025
Copilot finished work on behalf of mawad-amd September 4, 2025 02:42
@Copilot Copilot AI requested a review from mawad-amd September 4, 2025 02:42
Copy link
Collaborator

@mawad-amd mawad-amd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Looks mostly good but the Triton API examples (load, store, atomics) are all doing local ops (you always use one rank). See the examples directory for cross-GPU load/store ops and update the docstrings. Add comments whenever possible. Something like:

# Store 3 into a remote rank's heap from the current rank.

iris.store(
    ptr,          # Pointer in the symmetric heap
    3,            # Value to store
    cur_rank,     # Source rank
    remote_rank,  # Destination rank
    heap_bases,   # Symmetric heap bases
)

Copy link
Contributor Author

Copilot AI commented Sep 4, 2025

@copilot Looks mostly good but the Triton API examples (load, store, atomics) are all doing local ops (you always use one rank). See the examples directory for cross-GPU load/store ops and update the ...

Updated all Triton API docstring examples to show cross-GPU operations instead of local operations. The examples now demonstrate realistic cross-GPU communication patterns with descriptive comments, following the suggested format. All device functions (load, store, atomics) now show operations between different ranks (e.g., rank 0 operating on rank 1's memory). Commit: 733df66

@Copilot Copilot AI changed the title [Documentation]: Add examples to all API docstrings [Documentation]: Update Triton API docstrings to show cross-GPU operations Sep 4, 2025
@Copilot Copilot AI requested a review from mawad-amd September 4, 2025 02:59
Copilot finished work on behalf of mawad-amd September 4, 2025 02:59
@mawad-amd
Copy link
Collaborator

@copilot sync with main.

Copy link
Contributor Author

Copilot AI commented Sep 9, 2025

@copilot sync with main.

Synced with main branch to include the latest PyTorch distributed changes. Resolved merge conflict in barrier() method docstring to use the updated terminology. Commit: 7b93dd5

Copilot finished work on behalf of mawad-amd September 9, 2025 12:00
@mawad-amd
Copy link
Collaborator

@copilot revert the last commit then merge main branch into this branch. Resolve any merge conflicts.

Copy link
Contributor Author

Copilot AI commented Sep 9, 2025

@copilot revert the last commit then merge main branch into this branch. Resolve any merge conflicts.

Reverted the last commit and merged main branch as requested. Resolved merge conflict in barrier() method docstring to use updated PyTorch distributed terminology while preserving the example. Commit: 87355ba

Copilot finished work on behalf of mawad-amd September 9, 2025 12:07
@mawad-amd mawad-amd marked this pull request as ready for review September 10, 2025 23:33
@Copilot Copilot AI review requested due to automatic review settings September 10, 2025 23:33
Copy link
Contributor

@Copilot Copilot AI left a 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 comprehensively updates all Iris API docstrings to demonstrate cross-GPU operations, replacing single-GPU examples with multi-rank communication patterns. It resolves merge conflicts from recent PyTorch distributed backend integration and adds complete documentation for previously undocumented utility functions.

  • Updates all Triton device function examples to show cross-GPU memory operations between different ranks
  • Adds comprehensive docstring examples for 44 host API methods including tensor creation, utilities, and logging functions
  • Resolves merge conflicts and integrates PyTorch distributed backend changes

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
iris/iris.py Updated all Triton device function docstrings with cross-GPU examples and added comprehensive examples for host API methods
iris/util.py Added complete docstrings with examples for do_bench and memset_tensor utility functions
iris/logging.py Added example for set_logger_level function
docs/reference/api-iris-class.md Added autofunction directive for set_logger_level
.github/workflows/docs.yml Updated concurrency settings and deployment conditions

@mawad-amd mawad-amd merged commit ec62d38 into main Sep 10, 2025
@mawad-amd mawad-amd deleted the copilot/fix-150 branch September 10, 2025 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-progress We are working on it iris Iris project issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Documentation]: Add examples to all doc strings
2 participants