-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
TPS-free 2D bucket estimation and filtering #11738
Conversation
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
from lhotse.testing.dummies import DummyManifest, dummy_cut | ||
from nemo.collections.common.data.lhotse.sampling import FixedBucketBatchSizeConstraint2D | ||
from lhotse.testing.dummies import dummy_cut | ||
from lhotse.testing.random import deterministic_rng |
Check notice
Code scanning / CodeQL
Unused import Note test
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: pzelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
…com/nvidia/nemo into 2d-bucketing-and-tps-improvements-2
filter_2d = BucketingFilter(constraint) | ||
cut = make_cut(duration=2.0, num_tokens=20) | ||
assert filter_2d(cut) == False | ||
assert constraint.select_bucket(constraint.max_seq_len_buckets, cut) == None |
Check notice
Code scanning / CodeQL
Testing equality to None Note test
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -698,28 +709,32 @@ def make_structured_with_schema_warnings(config: DictConfig | dict) -> DictConfi | |||
if not isinstance(config, DictConfig): | |||
config = DictConfig(config) | |||
|
|||
if config.get("tarred_random_access", False): | |||
logging.warning( | |||
"Option 'tarred_random_access' is deprecated and replaced with 'skip_missing_manifest_entries'.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be also add version from which this would be removed
Signed-off-by: Piotr Zelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
49a1536
to
a238da2
Compare
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
beep boop 🤖: 🚨 The following files must be fixed before merge! Your code was analyzed with PyLint. The following annotations have been identified:
Mitigation guide:
By applying these rules, we reduce the occurance of this message in future. Thank you for improving NeMo's documentation! |
[🤖]: Hi @pzelasko 👋, We wanted to let you know that a CICD pipeline for this PR just finished successfully So it might be time to merge this PR or get some approvals I'm just a bot so I'll leave it you what to do next. //cc @pablo-garay @ko3n1g |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* TPS-free 2D bucket estimation and filtering Signed-off-by: Piotr Żelasko <[email protected]> * fixes Signed-off-by: Piotr Żelasko <[email protected]> * extra unit test Signed-off-by: Piotr Żelasko <[email protected]> * Fixes in 2D bin estimation script and OOMptimizer Signed-off-by: Piotr Żelasko <[email protected]> * Apply isort and black reformatting Signed-off-by: pzelasko <[email protected]> * Support list values for max_tps/max_tpt and bucketing Signed-off-by: Piotr Żelasko <[email protected]> * fix max_tps/max_tpt config parsing for list values Signed-off-by: Piotr Żelasko <[email protected]> * Transition: tarred_random_access -> skip_missing_manifest_entries Signed-off-by: Piotr Żelasko <[email protected]> * Improve warning messages Signed-off-by: Piotr Żelasko <[email protected]> * Support single unified BPE tokenizer for Canary2 Signed-off-by: Piotr Zelasko <[email protected]> * bugfix +es to unified tokenizer support for Canary Signed-off-by: Piotr Żelasko <[email protected]> * CanaryBPETokenizer Signed-off-by: Piotr Żelasko <[email protected]> * Revert changes to fetching pad id in AED models Signed-off-by: Piotr Żelasko <[email protected]> * Update docs Signed-off-by: Piotr Żelasko <[email protected]> * fix tests Signed-off-by: Piotr Żelasko <[email protected]> * Remove max_tps and max_duration from OOMptimizer output Signed-off-by: Piotr Żelasko <[email protected]> --------- Signed-off-by: Piotr Żelasko <[email protected]> Signed-off-by: Piotr Żelasko <[email protected]> Signed-off-by: pzelasko <[email protected]> Signed-off-by: Piotr Zelasko <[email protected]> Co-authored-by: pzelasko <[email protected]> Signed-off-by: Parth Mannan <[email protected]>
* TPS-free 2D bucket estimation and filtering Signed-off-by: Piotr Żelasko <[email protected]> * fixes Signed-off-by: Piotr Żelasko <[email protected]> * extra unit test Signed-off-by: Piotr Żelasko <[email protected]> * Fixes in 2D bin estimation script and OOMptimizer Signed-off-by: Piotr Żelasko <[email protected]> * Apply isort and black reformatting Signed-off-by: pzelasko <[email protected]> * Support list values for max_tps/max_tpt and bucketing Signed-off-by: Piotr Żelasko <[email protected]> * fix max_tps/max_tpt config parsing for list values Signed-off-by: Piotr Żelasko <[email protected]> * Transition: tarred_random_access -> skip_missing_manifest_entries Signed-off-by: Piotr Żelasko <[email protected]> * Improve warning messages Signed-off-by: Piotr Żelasko <[email protected]> * Support single unified BPE tokenizer for Canary2 Signed-off-by: Piotr Zelasko <[email protected]> * bugfix +es to unified tokenizer support for Canary Signed-off-by: Piotr Żelasko <[email protected]> * CanaryBPETokenizer Signed-off-by: Piotr Żelasko <[email protected]> * Revert changes to fetching pad id in AED models Signed-off-by: Piotr Żelasko <[email protected]> * Update docs Signed-off-by: Piotr Żelasko <[email protected]> * fix tests Signed-off-by: Piotr Żelasko <[email protected]> * Remove max_tps and max_duration from OOMptimizer output Signed-off-by: Piotr Żelasko <[email protected]> --------- Signed-off-by: Piotr Żelasko <[email protected]> Signed-off-by: Piotr Żelasko <[email protected]> Signed-off-by: pzelasko <[email protected]> Signed-off-by: Piotr Zelasko <[email protected]> Co-authored-by: pzelasko <[email protected]> Signed-off-by: Abhinav Garg <[email protected]>
What does this PR do ?
Improves the UX of estimating 2D buckets and preparing the training configuration. Key changes:
model.train_ds.bucketing_2d_strict_mode=False
): find any bucket that will fit a given example. That means token-per-second outliers are pushed to buckets with higher durations increasing the padding but reducing the amount of discarded data. Use at your own risk - for the setups I tested it so far with, it may cause training instability (likely due to inclusion of lower-quality data).estimate_duration_bins_2d.py
script.estimate_duration_bins_2d.py
.tarred_random_access
toskip_missing_manifest_entries
and adjusted the logic to reduce CPU memory usage and accelerate loading time.Collection: ASR, TTS, SpeechLLM
Changelog
Usage
# 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:
PR Type:
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