1. 24 Apr, 2020 1 commit
    • moto's avatar
      Run unit test on CCI (#576) · a47dca4f
      moto authored
      * wip
      
      * Add test
      
      * add caching
      
      * fixup! add caching
      
      * fixup! fixup! add caching
      a47dca4f
  2. 23 Apr, 2020 2 commits
  3. 22 Apr, 2020 3 commits
  4. 21 Apr, 2020 2 commits
  5. 20 Apr, 2020 3 commits
    • moto's avatar
      Improve lfilter speed (#564) · 27a0f765
      moto authored
      Before
      
      Total time: 13.7078
      
      ```
         722|    220501|      2.44247|  1.10769e-05| 17.82%|    for i_sample, o0 in enumerate(input_signal_windows.t()):
      (call)|         1|  6.36578e-05|  6.36578e-05|  0.00%|# /scratch/moto/pytorch/torch/tensor.py:460 __iter__
      (call)|    220500|      1.60566|  7.28191e-06| 11.71%|# /scratch/moto/pytorch/torch/tensor.py:474 <lambda>
         723|    220500|      1.86697|  8.46698e-06| 13.62%|        windowed_output_signal = padded_output_waveform[:, i_sample:(i_sample + n_order)]
         724|    220500|      1.94628|  8.82669e-06| 14.20%|        o0.addmv_(windowed_output_signal, a_coeffs_flipped, alpha=-1)
         725|    220500|         2.46|  1.11565e-05| 17.94%|        o0.div_(a_coeffs[0])
         726|         0|            0|            0|  0.00%|
         727|    220500|      3.37869|  1.53229e-05| 24.64%|        padded_output_waveform[:, i_sample + n_order - 1] = o0
      ```
      
      After
      
      Total time: 10.9667
      
      ```
         722|         1|   9.2268e-05|   9.2268e-05|  0.00%|    input_signal_windows.div_(a_coeffs[0])
         723|         1|  2.14577e-05|  2.14577e-05|  0.00%|    a_coeffs_flipped.div_(a_coeffs[0])
         724|    220501|      2.40216|  1.08941e-05| 21.90%|    for i_sample, o0 in enumerate(input_signal_windows.t()):
      (call)|         1|  5.84126e-05|  5.84126e-05|  0.00%|# /scratch/moto/pytorch/torch/tensor.py:460 __iter__
      (call)|    220500|      1.59821|   7.2481e-06| 14.57%|# /scratch/moto/pytorch/torch/tensor.py:474 <lambda>
         725|    220500|      1.82273|  8.26633e-06| 16.62%|        windowed_output_signal = padded_output_waveform[:, i_sample:(i_sample + n_order)]
         726|    220500|      1.84074|  8.34802e-06| 16.78%|        o0.addmv_(windowed_output_signal, a_coeffs_flipped, alpha=-1)
         727|    220500|       3.2952|  1.49442e-05| 30.05%|        padded_output_waveform[:, i_sample + n_order - 1] = o0
      ```
      27a0f765
    • moto's avatar
      Remove unused helper function (#565) · 66d3e3fa
      moto authored
      66d3e3fa
    • Bhargav Kathivarapu's avatar
      Add dcshift to functional (#558) · 91e59231
      Bhargav Kathivarapu authored
      * Add dcshift to functional
      
      * Doc string change and remove inplace clamp
      
      * Minor Fix to dcshit and separate sox test refactoring
      
      * Minor change to limiter_gain type
      
      * adding dcshift to __all__ in functional
      91e59231
  6. 17 Apr, 2020 3 commits
  7. 16 Apr, 2020 2 commits
  8. 15 Apr, 2020 1 commit
  9. 14 Apr, 2020 7 commits
    • Vincent QB's avatar
      Fixes #545 (#547) · 8c05bfab
      Vincent QB authored
      8c05bfab
    • moto's avatar
      Simplify and abstract away asset access in test (#542) · 0e5581cb
      moto authored
      This PR aims the following things;
      1. Introduce and adopt helper function `get_asset_path` that abstract the logic to construct path to test assets.
      2. Remove `create_temp_assets_dir` anywhere except `test_io`.
      
      The benefits of doing so are,
      a. the test code becomes simpler (no manual construction of asset path with `os.path.join`)
      b. No unnecessary directory creation and file copies.
      
      For 2. and b. tests in `test_io.py` (or tests that use `torchaudio.save`) are the only tests that need to write file to the disc, where the use of temporary directory makes it cleaner, therefore, `create_temp_assets_dir` is not necessary elsewhere. (still, `test_io` does not need to copy the entire asset directory, but that's not the point here.)
      
      Also if any test is accidentally overwriting an asset data, not using a copy will make us aware of such behavior, so it is better to get rid of `create_temp_assets_dir`.
      0e5581cb
    • moto's avatar
      Remove duplicated lfilter tests (#541) · 0fa07595
      moto authored
      This lfilter tests were moved to `test_torchscript_consistency.py` in #507 and GPU tests were added in #528.
      We can safely remove this tests from `test_functional_filtering.py`.
      0fa07595
    • Tomás Osório's avatar
      Inline typing init (#526) · 3383a2d9
      Tomás Osório authored
      * inline typing first iteration
      
      * fix issue with mypy
      
      * change docstring
      
      * add more typing
      
      * fix to not break BC
      
      * update docstrings
      3383a2d9
    • moto's avatar
      Move lfilter basic test to test_functional (#539) · af88b925
      moto authored
      af88b925
    • moto's avatar
      Call torch.stft directly (#531) · 6304db75
      moto authored
      * Update requirements and travis installation
      
      * Drop support for 3.5 and add test for 3.8
      
      * Call torch.stft directly
      6304db75
    • moto's avatar
      Run test against PyTorch nightly on Travis CI (#538) · f3217257
      moto authored
      * Update requirements and travis installation
      
      * Drop support for 3.5 and add test for 3.8
      f3217257
  10. 13 Apr, 2020 3 commits
  11. 09 Apr, 2020 5 commits
  12. 08 Apr, 2020 1 commit
  13. 07 Apr, 2020 4 commits
    • Tomás Osório's avatar
      Inline typing utils dataset (#522) · 4e5ee9f1
      Tomás Osório authored
      
      
      * add inline typing to utils Dataset
      
      * add inline typing to common_utils
      
      * add missing inline typing
      
      * add typing to kwarg
      
      * add missing inline typing
      
      * update docstring
      
      * undo indentation
      Co-authored-by: default avatarVincent QB <vincentqb@users.noreply.github.com>
      4e5ee9f1
    • moto's avatar
      Refactor torchscript test helper function (#521) · a9c4d0a8
      moto authored
      a9c4d0a8
    • moto's avatar
      Refactor batch test helper function (#519) · 657f0a02
      moto authored
      657f0a02
    • moto's avatar
      Use fused op in lfilter (#517) · 86d54160
      moto authored
      This improves the speed of `lfilter` (and functions that use `lfilter`, such as `biquad`) by 10%.
      
      * Before (23.4369 seconds for `lfilter` call)
      
      Breakdown
      
      ```
         720|    220501|       4.4464|   2.0165e-05| 18.97%|    for i_sample, o0 in enumerate(input_signal_windows.t()):
      (call)|         1|  7.86781e-05|  7.86781e-05|  0.00%|# /scratch/moto/pytorch/torch/tensor.py:460 __iter__
      (call)|    220500|      2.72458|  1.23564e-05| 11.62%|# /scratch/moto/pytorch/torch/tensor.py:474 <lambda>
         721|    220500|      2.80982|   1.2743e-05| 11.99%|        windowed_output_signal = padded_output_waveform[:, i_sample:(i_sample + n_order)]
         722|    220500|      4.92106|  2.23177e-05| 21.00%|        o0.sub_(torch.mv(windowed_output_signal, a_coeffs_flipped))
         723|    220500|      3.72974|  1.69149e-05| 15.91%|        o0.div_(a_coeffs[0])
         724|         0|            0|            0|  0.00%|
         725|    220500|      4.77714|   2.1665e-05| 20.38%|        padded_output_waveform[:, i_sample + n_order - 1] = o0
      ```
      
      * After (20.8405 seconds for `lfilter` call)
      
      Breakdown
      
      ```
         720|    220501|      4.40834|  1.99924e-05| 21.15%|    for i_sample, o0 in enumerate(input_signal_windows.t()):
      (call)|         1|  7.31945e-05|  7.31945e-05|  0.00%|# /scratch/moto/pytorch/torch/tensor.py:460 __iter__
      (call)|    220500|      2.68595|  1.21812e-05| 12.89%|# /scratch/moto/pytorch/torch/tensor.py:474 <lambda>
         721|    220500|      2.97357|  1.34856e-05| 14.27%|        windowed_output_signal = padded_output_waveform[:, i_sample:(i_sample + n_order)]
         722|    220500|      2.63567|  1.19531e-05| 12.65%|        o0.addmv_(windowed_output_signal, a_coeffs_flipped)
         723|    220500|       3.4228|  1.55229e-05| 16.42%|        o0.div_(a_coeffs[0])
         724|         0|            0|            0|  0.00%|
         725|    220500|      4.68726|  2.12574e-05| 22.49%|        padded_output_waveform[:, i_sample + n_order - 1] = o0
      ```
      
      * Script
      
      ```python
      import pprofile
      
      import torch
      import torchaudio
      import torchaudio.functional as F
      
      def profile_biquad():
          waveform, sr = torchaudio.load('test/assets/100Hz_44100Hz_16bit_05sec.wav', normalization=True)
      
          prof = pprofile.Profile()
          with prof():
              F.equalizer_biquad(waveform, sr, 3000, 1, 0.707)
          prof.print_stats()
      
      profile_biquad()
      ```
      
      * See also
      
      https://github.com/pytorch/audio/issues/260#issuecomment-610074110
      86d54160
  14. 06 Apr, 2020 3 commits
    • moto's avatar
      Fix GPU test skip logic (#516) · f37d37d6
      moto authored
      f37d37d6
    • moto's avatar
      Use torch.testing.assert_allclose (#513) · 5f5df1d6
      moto authored
      * grep -l 'torch.allclose' -r test | xargs sed -i 's/assert torch.allclose/torch.testing.assert_allclose/g'
      
      * grep -l 'torch.allclose' -r test | xargs sed -i 's/self.assertTrue(torch.allclose(\(.*\)))/torch.testing.assert_allclose(\1)/g'
      
      * Fix missing atol/rtol, wrong shape, argument order. Remove redundant shape assertions
      5f5df1d6
    • moto's avatar
      Simplify helper function (#514) · bc1ffb11
      moto authored
      bc1ffb11