Skip to content

Added initial AI Agent instructions and skills#448

Open
Micky774 wants to merge 3 commits intodevfrom
zain/gh-copilot-instructions
Open

Added initial AI Agent instructions and skills#448
Micky774 wants to merge 3 commits intodevfrom
zain/gh-copilot-instructions

Conversation

@Micky774
Copy link
Copy Markdown
Contributor

@Micky774 Micky774 commented Feb 12, 2026

Description

Includes an initial addition of repository-level AI agent instructions/context via CLAUDE.md as well as example skills via .claude/**/SKILL.md. This mainly serves as a demonstration of how to add additional context to AI coding agents, as well as how to develop a reasonably-complex skill.

TODO: Back-test against old cases and refine as needed

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • Adds CLAUDE.md
  • Adds .claude/ck-debugging/SKILL.md
  • Adds .claude/ifu-merge/SKILL.md

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Micky774 Micky774 force-pushed the zain/gh-copilot-instructions branch 7 times, most recently from c41a2c5 to fce9ca5 Compare March 4, 2026 22:56
@Micky774 Micky774 force-pushed the zain/gh-copilot-instructions branch from fce9ca5 to 8a8ea81 Compare March 5, 2026 18:53
---
name: ifu-merge
description: >
Guide for performing IFU (Internal Feature Update) merges on the TransformerEngine ROCm fork.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IFU stands for intergrate from upstream

- Preprocessor guards (`#ifndef USE_ROCM`, `#ifdef __HIP_PLATFORM_AMD__`). This means adding guards to source `.cpp` files will propagate into the generated `_hip.cpp` output. Use this to exclude CUDA-only code paths from ROCm builds.

**Rules that follow:**
- Never edit `*_hip.cpp` or `.hip` files — they are regenerated from source files
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We have one exception of .hip file in the repo. Maybe we can rename it for consistency

|---|---|---|
| PyTorch CSRC (`.cpp` source files) | `#ifdef USE_ROCM` / `#ifndef USE_ROCM` | DeviceGuard, scale swizzling |
| Common layer (`.cu` files that get hipified) | `#ifdef __HIP_PLATFORM_AMD__` | Warp masks, kernel dispatch |
| Python code | `IS_HIP_EXTENSION` (from `torch.utils.cpp_extension`) | Workspace sizing, feature flags |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also guard for JAX Python code

git diff <rocm-parent>..<upstream-parent> --stat

# Check for removed guards
git diff <rocm-parent>..<upstream-parent> -- <file> | grep -E "^-.*(__HIP_PLATFORM_AMD__|USE_ROCM|IS_HIP_EXTENSION)"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would also add "ROCm" and "upstream" - those are comments that indicate some changes made by us


5. **Convention Changes**: Upstream changes a data format, tensor shape, or API contract without any code conflict. Every downstream consumer of that convention must be updated manually — the compiler won't catch these.

**How to systematically audit:**
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should "what to pay attention to" points be here?
We have two big semantic differences:
__shfl vs __shfl_sync and other lane communication built-ins
fp8 data types: i.e. torch.float8_e4m3fn vs get_torch_e4m3_type, etc.

@Micky774 Micky774 changed the title Added initial GH Copilot instructions Added initial AI Agent instructions and skills Mar 27, 2026
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.

2 participants