Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Diffusion Training #11240

Closed
wants to merge 1 commit into from

Conversation

zpx01
Copy link
Collaborator

@zpx01 zpx01 commented Nov 9, 2024

What does this PR do ?

Adds the following new features to the Diffusion Training Framework:

  • FSDP support
  • MovieGen 1B/5B/30B Stages 1-3 Training with FSDP + TP/SP + CP
  • EC-DiT model (https://arxiv.org/abs/2410.02098)
  • Adds mock video data module for mock training across stages 1-3
  • Mixed Image-Video Training with THD Packed Sequencing

Collection: diffusion

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

Signed-off-by: Zeeshan Patel <[email protected]>

packed sequence support

Signed-off-by: Zeeshan Patel <[email protected]>

fixed pylint issues

Signed-off-by: Zeeshan Patel <[email protected]>

add docstrings + remove unused import

Signed-off-by: Zeeshan Patel <[email protected]>

Apply isort and black reformatting

Signed-off-by: zpx01 <[email protected]>
Signed-off-by: Zeeshan Patel <[email protected]>

added some missing args

Signed-off-by: Zeeshan Patel <[email protected]>

reformat

Signed-off-by: Zeeshan Patel <[email protected]>

moving fps embedder to gpu

Signed-off-by: Zeeshan Patel <[email protected]>

moving fps tensor  to gpu

Signed-off-by: Zeeshan Patel <[email protected]>

updated models

Signed-off-by: Zeeshan Patel <[email protected]>

added missing import

Signed-off-by: Zeeshan Patel <[email protected]>

added new configs + bug fixes

Signed-off-by: Zeeshan Patel <[email protected]>

seq len fix

Signed-off-by: Zeeshan Patel <[email protected]>

Apply isort and black reformatting

Signed-off-by: zpx01 <[email protected]>
Signed-off-by: Zeeshan Patel <[email protected]>

added nsys callback

Signed-off-by: Zeeshan Patel <[email protected]>

Apply isort and black reformatting

Signed-off-by: zpx01 <[email protected]>
Signed-off-by: Zeeshan Patel <[email protected]>

isort fix

Signed-off-by: Zeeshan Patel <[email protected]>
@zpx01 zpx01 force-pushed the zpx01/clean_dit_advanced_training branch from 424aabf to 1323ef9 Compare November 9, 2024 01:32

video_latent = torch.ones(self.seq_length, c * p**2, dtype=torch.bfloat16) * 0.5
text_embedding = torch.randn(self.text_seqlen, self.text_dim, dtype=torch.bfloat16)
pos_emb = pos_id_3d.get_pos_id_3d(t=t, h=h // p, w=w // p).reshape(-1, 3)

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable pos_emb is not used.
Comment on lines +540 to +546
torch.cuda.memory._record_memory_history(
True,
# Keep 100,000 alloc/free events from before the snapshot
trace_alloc_max_entries=100000,
# Record stack information for the trace events
trace_alloc_record_context=True,
)

Check warning

Code scanning / CodeQL

Unreachable code Warning

This statement is unreachable.
@zpx01 zpx01 closed this Nov 10, 2024
@zpx01 zpx01 deleted the zpx01/clean_dit_advanced_training branch November 10, 2024 03:17
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.

1 participant