-
Notifications
You must be signed in to change notification settings - Fork 3.7k
WIP #24837
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
Closed
Closed
WIP #24837
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
4c4f629
bugfix
prathikr 229ecff
run test only for webgpu
prathikr 574936d
lint
prathikr 29d1905
check zeros or inf
prathikr afbeb68
merge
prathikr c233f97
lint
prathikr fb8db93
;
prathikr 656619b
zero inf bug fix
prathikr b6c6350
merge
prathikr 10f2682
lint
prathikr d0e04c9
simpler fix
prathikr 0f645f4
remove extra test
prathikr 95e49a6
log sum exp
prathikr 3c77d77
Merge remote-tracking branch 'origin' into prathikrao/softmax-nan-bug
prathikr 23c8da4
remove max
prathikr bc1ebe9
handle 0
prathikr b45379d
test test case
prathikr 16741f0
adjust test
prathikr 1129883
protect nan
prathikr fcec212
skip test on cpu
prathikr ad7ed3b
type
prathikr 3b25841
;
prathikr b984456
kcpu
prathikr 3f699a3
comment
prathikr c68cc41
bug
prathikr 883c798
adjust test again
prathikr aed44f9
bruh
prathikr a119cf6
test run
prathikr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -49,6 +49,22 @@ TEST(SoftmaxOperator, Simple) { | |||||||||||||
| RunTest(x_vals, expected_vals, dimensions); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| #ifdef USE_WEBGPU | ||||||||||||||
| TEST(SoftmaxOperator, webgpu_nan) { | ||||||||||||||
| OpTester test("Softmax", 13); // axis default is -1 | ||||||||||||||
|
|
||||||||||||||
| std::vector<float> x_vals = {-INFINITY, -INFINITY, -INFINITY}; | ||||||||||||||
| std::vector<float> expected_result = {0.0f, 0.0f, 0.0f}; | ||||||||||||||
| std::vector<int64_t> dimensions = {1, 3}; | ||||||||||||||
|
|
||||||||||||||
| test.AddInput<float>("X", dimensions, x_vals); | ||||||||||||||
| test.AddOutput<float>("Y", dimensions, expected_result); | ||||||||||||||
|
|
||||||||||||||
| // explicitly disable CPU EP for this test since CPU implementation does not handle NaN | ||||||||||||||
|
Comment on lines
+61
to
+63
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kCpuExecutionProvider}); | ||||||||||||||
| } | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #if defined(USE_CUDA) || defined(USE_ROCM) || defined(USE_XNNPACK) | ||||||||||||||
| TEST(SoftmaxOperator, Simple_fp16) { | ||||||||||||||
| #ifdef USE_CUDA | ||||||||||||||
|
|
||||||||||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.