Skip to content

torch.export for HSTU dense model#327

Draft
jensenhwa wants to merge 5 commits intoNVIDIA:mainfrom
jensenhwa:jhwa/snap_export
Draft

torch.export for HSTU dense model#327
jensenhwa wants to merge 5 commits intoNVIDIA:mainfrom
jensenhwa:jhwa/snap_export

Conversation

@jensenhwa
Copy link
Copy Markdown

No description provided.

disable_kvcache=args.disable_kvcache,
max_bs=args.max_bs,
)
elif args.mode == RunningMode.SNAP:
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.

Adding a new mode for export is strange to me. Can we replace the inference code path w/o kvcache with this new exportable implementation?

~$ python3 ./inference/inference_gr_ranking.py --gin_config_file ./inference/configs/kuairand_1k_inference_ranking.gin --checkpoint_dir ${PATH_TO_CHECKPOINT} --mode eval
```

## Example: Kuairand-1K for Snap
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.

it's better for us not to name it as Snap

ebc_config.dim == self._embedding_dim
), "hstu layer hidden size should equal to embedding dim"

self._hstu_block = HSTUBlockInference(hstu_config, kvcache_config)
Copy link
Copy Markdown
Collaborator

@shijieliu shijieliu Mar 31, 2026

Choose a reason for hiding this comment

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

choose between HSTUBlockInference or HSTUBlock by configuration @geoffreyQiu

@@ -0,0 +1,103 @@
ARG BASE_IMAGE=nvcr.io/nvidia/pytorch:26.02-py3
Copy link
Copy Markdown
Collaborator

@shijieliu shijieliu Mar 31, 2026

Choose a reason for hiding this comment

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

@geoffreyQiu try merge this dockerfile with existing dockerfile. if needed, we can update torchrec to 1.4.0 or 1.5.0. but torchrec 1.5.0 needs compatibility change in dynamicemb

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.

merge this into fbgemm dev after verified

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.

3 participants