Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 4, 2025

Documentation for iris.hip module

  • Add comprehensive docstrings to all functions in iris/hip.py following NumPy/Google style
  • Create new API reference page: docs/reference/api-hip-module.md
  • Update docs/sphinx/_toc.yml to include the new HIP module documentation
  • Update docs/reference/api-reference.md to link to HIP module documentation
  • Run linting to ensure code quality
  • Remove unused APIs not used in codebase
  • Remove internal APIs from documentation
  • Document only APIs used in examples/tests
  • Fix XCC acronym definition

Final documented APIs (2 functions):

  • get_wall_clock_rate() - Used in 6 GEMM examples for GPU frequency queries
  • get_num_xcc() - Used in unit tests for XCC (Accelerated Compute Core) count queries

Not documented (internal use only):

  • set_device, get_cu_count, count_devices - Used internally by iris.py
  • get_ipc_handle, open_ipc_handle - Used internally for IPC operations
  • hip_try, hipIpcMemHandle_t, get_device_id, get_rocm_version - Internal helpers
Original prompt

This section details on the original issue you should resolve

<issue_title>[Documentation]: Document the HIP Module</issue_title>
<issue_description>### Description of errors

The iris.hip module is not part of the documentation and all functions in it are not documented. Document all APIs. Add the APIs to the web docs. Follow the guidelines and examples we have in iris.py

Attach any links, screenshots, or additional evidence you think will be helpful.

No response</issue_description>

<agent_instructions>Make sure to follow our documentation style. </agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #187

💡 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.

@Copilot Copilot AI changed the title [WIP] [Documentation]: Document the HIP Module [Documentation]: Add comprehensive documentation for iris.hip module Oct 4, 2025
@Copilot Copilot AI requested a review from mawad-amd October 4, 2025 03:48
Copilot finished work on behalf of mawad-amd October 4, 2025 03:48

### set_device
```{eval-rst}
.. autofunction:: iris.hip.set_device
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot some APIs here are not used in the code base. If they are not used, remove them. If they are not used in the examples or tests, also remove them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed 4 unused functions from the hip module: get_arch_string, hip_malloc, malloc_fine_grained, and hip_free. All remaining 11 functions are either used directly in the codebase (iris.py, examples, tests) or used internally by other functions. Commit: SHORT_HASH

Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot some apis are internal usage only. we dont need to expose them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed 4 internal APIs from documentation: hip_try, hipIpcMemHandle_t, get_device_id, and get_rocm_version. These remain in the code for internal use but are no longer exposed in the public API docs. Only 7 public APIs are now documented. Commit: 449f300

Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot are set and count_devices devices used? get_ipc_handle and open_ipc_handle are internal usage only. Move them into internal or a detail file. I only want functions used in examples to be documented and part of hip module.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated documentation to include only APIs used in examples/tests. Now documenting only 2 functions:

  • get_wall_clock_rate (used in 6 GEMM examples)
  • get_num_xcc (used in tests)

Removed from documentation: set_device, count_devices, get_cu_count, get_ipc_handle, open_ipc_handle (all internal use only). Commit: b8778e6

@Copilot Copilot AI requested a review from mawad-amd October 4, 2025 04:14
Copilot finished work on behalf of mawad-amd October 4, 2025 04:14
Copilot finished work on behalf of mawad-amd October 4, 2025 22:07
@Copilot Copilot AI changed the title [Documentation]: Add comprehensive documentation for iris.hip module [Documentation]: Document user-facing iris.hip module APIs Oct 4, 2025
Copilot finished work on behalf of mawad-amd October 4, 2025 22:45
iris/hip.py Outdated
"""
Get the number of XCCs (Compute Dies) for a HIP device.
XCC (eXtended Compute Complex) refers to the compute dies in MI300 series GPUs.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot XCC Accelerated Compute Core

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated XCC acronym definition to "Accelerated Compute Core" in the docstring. Commit: a36e9a1

@Copilot Copilot AI requested a review from mawad-amd October 4, 2025 22:55
Copilot finished work on behalf of mawad-amd October 4, 2025 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Documentation]: Document the HIP Module
2 participants