Skip to content

Conversation

@Micky774
Copy link
Contributor

Description

Please include a brief summary of the changes, relevant motivation and context.

Fixes # (issue)

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:

  • Change A
  • Change B

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

Copy link
Collaborator

@ipanfilo ipanfilo left a comment

Choose a reason for hiding this comment

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

Why ck_fused_attn_bwd needs modification if the PR is for fwd-pass only?

@Micky774 Micky774 changed the title JAX FA Benchmarking Script (fwd-pass only) JAX FA Benchmarking Script Oct 31, 2025
@Micky774
Copy link
Contributor Author

Note that I have added the BWD pass implementation as well to this PR.

@Micky774 Micky774 requested a review from ipanfilo November 5, 2025 20:48
@Micky774
Copy link
Contributor Author

Pinging @wangye805 @wenchenvincent in case either of you are interested in reviewing this PR as well, thanks!

## JAX Fused-Attention Benchmarking
The benchmarking process is split into two stages: *generating* the timing data, and *visualizing* the timing data. The following steps assume you are located in `TransformerEngine/benchmarks/attention` (i.e. where this README is located). First, ensure that you install requirements via `pip install -r requirements.txt`.

Note: Only forward timings are supported at this point.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

from transformer_engine.jax import fp8_autocast

# Needed in order to dump timings properly
os.environ["XLA_FLAGS"]="--xla_gpu_graph_level=0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this because you used dumping time function in ck fused attention?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

@Micky774 Micky774 self-assigned this Dec 1, 2025
attn_bias_type, bias_shape = bias_config
window_size = None
if swa:
window_size = (s_kv // 10, 0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do this for SWA?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was taken from our JAX FA testing.

@wenchenvincent
Copy link
Collaborator

Have you compared the kernel time measured from CK FA API vs from rocprof?

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.

4 participants