[lhotse] Support for NeMo tarred manifests with offset field#10035
Merged
[lhotse] Support for NeMo tarred manifests with offset field#10035
Conversation
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
zhehuaichen
added a commit
to zhehuaichen/NeMo
that referenced
this pull request
Aug 4, 2024
Signed-off-by: zhehuaichen <dian.chenzhehuai@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
a72e988 to
60dae9f
Compare
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
zhehuaichen
approved these changes
Aug 6, 2024
Collaborator
There was a problem hiding this comment.
looks good to me . @KunalDhawan or @tango4j can either of you guys also take a look?
I will do a test with this PR
KunalDhawan
approved these changes
Aug 6, 2024
Collaborator
KunalDhawan
left a comment
There was a problem hiding this comment.
LGTM, thank you Piotr!
zhehuaichen
added a commit
to zhehuaichen/NeMo
that referenced
this pull request
Aug 13, 2024
Signed-off-by: zhehuaichen <dian.chenzhehuai@gmail.com>
Contributor
|
@pzelasko I checked, caching def taropen_build(tar_path):
import tarfile
tar = tarfile.open(tar_path)
tarinfo_index = {tarinfo.name : tarinfo for tarinfo in tar.getmembers()}
return lambda member_path, mode: tar.extractfile(tarinfo_index[member_path]) if mode == 'rb' else None
# instead for uncompressed tars (which makes sense for audio files) can do without caching the TarInfo structure and just cache two ints per string file name, this makes it more amenable to sharing between DataLoader threads and easier to sync in tensors
#import io
#tarinfo_index = {tarinfo.name : (tarinfo.offset_data, tarinfo.size) for tarinfo in tar.getmembers()}
#return lambda member_path, mode: [io.BytesIO(f.seek(e[0]) and f.read(e[1])) for f in [open(tar_path, mode)] for e in [tarinfo_index[member_path]]][0] if mode == 'rb' else None
if __name__ == '__main__':
taropen = taropen_build('myfile.tar')
print(taropen('mymember.txt', 'rb').read())Supporting |
Collaborator
Author
|
We already support tars with wav/opus. Linear scan is not feasible for URL data sources (cloud storage, AIStore). |
adityavavre
pushed a commit
to adityavavre/NeMo
that referenced
this pull request
Sep 15, 2024
…NeMo#10035) * [lhotse] Support for NeMo tarred manifests with offset field Signed-off-by: Piotr Żelasko <petezor@gmail.com> * typo fix Signed-off-by: Piotr Żelasko <petezor@gmail.com> * fix basename Signed-off-by: Piotr Żelasko <petezor@gmail.com> * relieve heavy CPU memory usage for super-long tarred recordings Signed-off-by: Piotr Żelasko <petezor@gmail.com> * Tests and fixes Signed-off-by: Piotr Żelasko <petezor@gmail.com> --------- Signed-off-by: Piotr Żelasko <petezor@gmail.com> Signed-off-by: adityavavre <aditya.vavre@gmail.com>
monica-sekoyan
pushed a commit
that referenced
this pull request
Oct 14, 2024
* [lhotse] Support for NeMo tarred manifests with offset field Signed-off-by: Piotr Żelasko <petezor@gmail.com> * typo fix Signed-off-by: Piotr Żelasko <petezor@gmail.com> * fix basename Signed-off-by: Piotr Żelasko <petezor@gmail.com> * relieve heavy CPU memory usage for super-long tarred recordings Signed-off-by: Piotr Żelasko <petezor@gmail.com> * Tests and fixes Signed-off-by: Piotr Żelasko <petezor@gmail.com> --------- Signed-off-by: Piotr Żelasko <petezor@gmail.com>
hainan-xv
pushed a commit
to hainan-xv/NeMo
that referenced
this pull request
Nov 5, 2024
…NeMo#10035) * [lhotse] Support for NeMo tarred manifests with offset field Signed-off-by: Piotr Żelasko <petezor@gmail.com> * typo fix Signed-off-by: Piotr Żelasko <petezor@gmail.com> * fix basename Signed-off-by: Piotr Żelasko <petezor@gmail.com> * relieve heavy CPU memory usage for super-long tarred recordings Signed-off-by: Piotr Żelasko <petezor@gmail.com> * Tests and fixes Signed-off-by: Piotr Żelasko <petezor@gmail.com> --------- Signed-off-by: Piotr Żelasko <petezor@gmail.com> Signed-off-by: Hainan Xu <hainanx@nvidia.com>
XuesongYang
pushed a commit
to paarthneekhara/NeMo
that referenced
this pull request
Jan 18, 2025
…NeMo#10035) * [lhotse] Support for NeMo tarred manifests with offset field Signed-off-by: Piotr Żelasko <petezor@gmail.com> * typo fix Signed-off-by: Piotr Żelasko <petezor@gmail.com> * fix basename Signed-off-by: Piotr Żelasko <petezor@gmail.com> * relieve heavy CPU memory usage for super-long tarred recordings Signed-off-by: Piotr Żelasko <petezor@gmail.com> * Tests and fixes Signed-off-by: Piotr Żelasko <petezor@gmail.com> --------- Signed-off-by: Piotr Żelasko <petezor@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
Support for NeMo tarred manifests with offset field in lhotse dataloading.
Collection: ASR
Changelog
Usage
# Add a code snippet demonstrating how to use thisGitHub 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