Skip to content

[Common] Pack attention arguments as structs#3079

Draft
cyanguwa wants to merge 2 commits into
NVIDIA:mainfrom
cyanguwa:pack_args_with_struct
Draft

[Common] Pack attention arguments as structs#3079
cyanguwa wants to merge 2 commits into
NVIDIA:mainfrom
cyanguwa:pack_args_with_struct

Conversation

@cyanguwa
Copy link
Copy Markdown
Collaborator

@cyanguwa cyanguwa commented Jun 3, 2026

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

cyanguwa and others added 2 commits May 7, 2026 19:42
Signed-off-by: Charlene Yang <8636796+cyanguwa@users.noreply.github.com>
Copy link
Copy Markdown
Member

@timmoon10 timmoon10 left a comment

Choose a reason for hiding this comment

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

Instead of exposing all of the options in a struct, it may be worth considering putting them in an opaque object like NVTEQuantizationConfig:

This has a few advantages:

  • The struct definition is fully within the core lib, so it's more robust to cases where libtransformer_engine.so and transformer_engine_torch are from different TE versions.
  • Default initialization is automatic and doesn't require the non-standard init macros.
  • It's easier to deprecate options. Remove the option from the internal struct, and either error out or ignore if the user attempts to set it.

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