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

Add exp and log math functions #2555

Merged
merged 6 commits into from Dec 16, 2020
Merged

Add exp and log math functions #2555

merged 6 commits into from Dec 16, 2020

Conversation

azrael417
Copy link
Contributor

Why we need this PR?

  • It adds log and exp preprocessing ops, the former is needed for one mlperf-hpc benchmark

What happened in this PR?

  • added dali.math.log and dali.math.exp functions to arithmetic expressions for CPU and GPU
  • if arguments are of non-FP type, arguments will be casted to FP32
  • added python test. The log test passes with precision requirement of 1e-6, the exp tests overflows, needs some debugging.
  • maybe we should specialize the exp and log templates to use the matching std types as well, at the cost of speed. That would not fix the GPU issues though
    Main files to look at (I am not listing files which just include some boilerplate handling of the new expressions):
  • dali/test/python/test_operator_arithmetic_ops.py
  • dali/operators/math/expressions/arithmetic_meta.h

JIRA TASK: NA

@klecki klecki self-assigned this Dec 16, 2020
Limit the range of data tested for log and exp
Add missing log and exp in value switch for to_string implementation.

Fix casting in the implementation

Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
@klecki
Copy link
Contributor

klecki commented Dec 16, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1914925]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1914925]: BUILD PASSED

@klecki klecki changed the title Math func Add exp and log math functions Dec 16, 2020
@klecki klecki merged commit 455a937 into NVIDIA:master Dec 16, 2020
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.

None yet

4 participants