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

Time major Spectrogram (GPU-only) #2617

Merged
merged 2 commits into from
Jan 18, 2021
Merged

Conversation

mzient
Copy link
Contributor

@mzient mzient commented Jan 15, 2021

Why we need this PR?

Pick one, remove the rest

  • It unlocks a feature: compute time-major spectrogram (GPU backend only) which should have superior performance

What happened in this PR?

Fill relevant points, put NA otherwise. Replace anything inside []

  • What solution was applied:
    • Added "layout" argument with 2 values "tf" and "ft".
    • The operator now assigns layout to the output
    • CPU variant checks that the layout is "ft" (the only one supported).
  • Affected modules and functionalities:
    • Spectrogram operator & tests
  • Key points relevant for the review:
    • N/A
  • Validation and testing:
    • Python tests
  • Documentation (including examples):
    • N/A

JIRA TASK: N/A

Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
@mzient mzient requested a review from a team January 15, 2021 16:35
@mzient
Copy link
Contributor Author

mzient commented Jan 15, 2021

!build

args.spectrum_type = static_cast<FftSpectrumType>(power);
args.time_major_layout = layout == "tf";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line does the whole trick :)

@@ -27,59 +27,65 @@
namespace dali {

DALI_SCHEMA(Spectrogram)
.DocStr(R"code(Produces a spectrogram from a 1D signal (for example, audio).
.DocStr(R"(Produces a spectrogram from a 1D signal (for example, audio).
Copy link
Contributor

Choose a reason for hiding this comment

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

I would keep this code, it is consistent with the rest of the documentation.

@klecki
Copy link
Contributor

klecki commented Jan 15, 2021

if HW (HeightWidth) is row-major, why is ft frequency major?

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1985403]: BUILD STARTED

@mzient
Copy link
Contributor Author

mzient commented Jan 15, 2021

if HW (HeightWidth) is row-major, why is ft frequency major?

The "major" coordinate is the outer one. Row-major is a matrix thing - it tells us that the outer coordinate indicates the row.

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1985403]: BUILD PASSED

@mzient mzient merged commit 4c061c3 into NVIDIA:master Jan 18, 2021
TheTimmy pushed a commit to TheTimmy/DALI that referenced this pull request Jan 20, 2021
* Add time-major GPU spectrogram.
* Add tests for time-major spectrogram.

Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
@JanuszL JanuszL mentioned this pull request May 19, 2021
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.

5 participants