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

Added VectorQuantizer base class #8011

Merged
merged 1 commit into from
Jan 20, 2024
Merged

Conversation

anteju
Copy link
Collaborator

@anteju anteju commented Dec 11, 2023

What does this PR do ?

This PR adds an abstract base class for vector quantizers.

Collection: TTS

Changelog

  • Added VectorQuantizerBase

Usage

n/a

Jenkins CI

To run Jenkins, a NeMo User with write access must comment jenkins on the PR.

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:

  • Refactor
  • 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)

@anteju
Copy link
Collaborator Author

anteju commented Dec 11, 2023

jenkins

@github-actions github-actions bot added the TTS label Dec 11, 2023
@anteju anteju requested a review from rlangman December 12, 2023 18:17
@anteju anteju force-pushed the pr/quantizer-base branch 2 times, most recently from 52def63 to 1d457b5 Compare December 13, 2023 00:16
@anteju anteju marked this pull request as ready for review December 13, 2023 00:16
@anteju
Copy link
Collaborator Author

anteju commented Dec 13, 2023

jenkins

Copy link
Contributor

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Dec 27, 2023
Copy link
Contributor

github-actions bot commented Jan 3, 2024

This PR was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this Jan 3, 2024
Copy link
Collaborator

@rlangman rlangman left a comment

Choose a reason for hiding this comment

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

Overall LGTM.

@@ -402,7 +432,7 @@ def decode(self, indices: torch.Tensor, input_len: Optional[torch.Tensor] = None
return dequantized


class GroupFiniteScalarQuantizer(NeuralModule):
class GroupFiniteScalarQuantizer(VectorQuantizerBase):
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the quantizers have the same interface then would it make sense to have just 1 grouped quantizer implementation/interface? I guess there would need to be a small amount of logic to specify how the underlying codebooks are created.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I had the same idea initially.
However, for now, I decided to leave them as separate implementations and only require them to conform with VectorQuantizerBase. The main reason is flexibility.

Unless there's a strong reason to do it right away, I'd suggest integrating this PR in the current form and revisit the group class in the future.

@anteju
Copy link
Collaborator Author

anteju commented Jan 19, 2024

jenkins

@anteju anteju merged commit dfaf500 into NVIDIA:main Jan 20, 2024
11 checks passed
PannuMuthu pushed a commit to PannuMuthu/NeMo that referenced this pull request Jan 26, 2024
Signed-off-by: Ante Jukić <[email protected]>
Signed-off-by: Pratyush Muthukumar <[email protected]>
PannuMuthu pushed a commit to PannuMuthu/NeMo that referenced this pull request Jan 29, 2024
Signed-off-by: Ante Jukić <[email protected]>
Signed-off-by: Pratyush Muthukumar <[email protected]>
PannuMuthu pushed a commit to PannuMuthu/NeMo that referenced this pull request Jan 29, 2024
stevehuang52 pushed a commit that referenced this pull request Jan 31, 2024
Signed-off-by: Ante Jukić <[email protected]>
Signed-off-by: stevehuang52 <[email protected]>
ssh-meister pushed a commit to ssh-meister/NeMo that referenced this pull request Feb 15, 2024
Signed-off-by: Ante Jukić <[email protected]>
Signed-off-by: Sasha Meister <[email protected]>
pablo-garay pushed a commit that referenced this pull request Mar 19, 2024
Signed-off-by: Ante Jukić <[email protected]>
Signed-off-by: Pablo Garay <[email protected]>
rohitrango pushed a commit to rohitrango/NeMo that referenced this pull request Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants