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

perf(utils): better implementation of repeat_expand_2d #216

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

BlueAmulet
Copy link
Collaborator

After doing some profiling I found that repeat_expand_2d is relatively slow. Rather than manually repeating the array, take advantage of torch.nn.functional.interpolate which is a couple orders of magnitude faster.

I have tested the new and old methods and found the results to be the same.

@codecov-commenter
Copy link

codecov-commenter commented Apr 3, 2023

Codecov Report

Merging #216 (b989a6d) into main (1a6c021) will increase coverage by 0.03%.
The diff coverage is 25.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #216      +/-   ##
==========================================
+ Coverage   19.93%   19.96%   +0.03%     
==========================================
  Files          38       38              
  Lines        3241     3235       -6     
  Branches      410      409       -1     
==========================================
  Hits          646      646              
+ Misses       2579     2573       -6     
  Partials       16       16              
Impacted Files Coverage Δ
src/so_vits_svc_fork/utils.py 21.02% <0.00%> (+0.57%) ⬆️
src/so_vits_svc_fork/__init__.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@BlueAmulet BlueAmulet force-pushed the perf/repeat_expand_2d branch from b989a6d to 1fe2267 Compare April 3, 2023 05:13
@34j
Copy link
Collaborator

34j commented Apr 3, 2023

I'm just impressed that you can touch that code...
By the way, I'm really worried about f0.interpolate_f0. Like it obviously shouldn't be called in training.

@34j 34j changed the title perf: better implementation of repeat_expand_2d perf(utils): better implementation of repeat_expand_2d Apr 3, 2023
@34j 34j merged commit ef30a9d into voicepaw:main Apr 3, 2023
@BlueAmulet BlueAmulet deleted the perf/repeat_expand_2d branch April 3, 2023 05:44
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.

3 participants