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

Fix OpenSora 1.2 training #643

Merged
merged 35 commits into from
Sep 27, 2024
Merged

Conversation

SamitHuang
Copy link
Collaborator

@SamitHuang SamitHuang commented Aug 28, 2024

What does this PR do?

Fixes # (issue)

  • train_steps set but stop earlier than expected

Acceleration:

  • compilation speedup by lazy_inline
  • step time speedup by: merge normalization, ms.Symbol, bucket balancing

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline?
  • Did you make sure to update the documentation with your changes? E.g. record bug fixes or new features in What's New. Here are the
    documentation guidelines
  • Did you build and run the code without any errors?
  • Did you report the running environment (NPU type/MS version) and performance in the doc? (better record it for data loading, model inference, or training tasks)
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@xxx

@@ -35,6 +35,8 @@


class STDiT3Block(nn.Cell):
# to reduce compilation time
@ms.lazy_inline(policy="front")
Copy link
Collaborator

Choose a reason for hiding this comment

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

vae的encoder和decoder也加下吧,解决动态shape OOM的问题

@@ -18,7 +18,7 @@ python scripts/train.py \
--pretrained_model_path="models/OpenSora-STDiT-v3/opensora_stdit_v3.ckpt" \
--mode=0 \
--jit_level O1 \
--max_device_memory 59GB \
--max_device_memory 55GB \
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this affect?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Set drop_remainder here to False as well to keep the consistency?

@SamitHuang SamitHuang added this pull request to the merge queue Sep 27, 2024
Merged via the queue into mindspore-lab:master with commit 7057ddb Sep 27, 2024
3 checks passed
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.

6 participants