-
Notifications
You must be signed in to change notification settings - Fork 547
Indexing: Use Param/Array::strides instead of toStride #2311
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
Merged
Conversation
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
Looks good to me. |
umar456
previously approved these changes
Oct 11, 2018
d7a981a
to
f99f2df
Compare
f99f2df
to
1e7d403
Compare
umar456
approved these changes
Oct 17, 2018
9prady9
approved these changes
Oct 17, 2018
facebook-github-bot
pushed a commit
to flashlight/flashlight
that referenced
this pull request
Apr 17, 2019
Summary: When testing CUDA ForceAlign, I encountered NaNs that seemed unrelated to ForceAlign. After investigation I discovered the NaNs were introduced during GLU. During one particular forward pass, in one particular GLU layer, the array `input.array()(fhalf[0], fhalf[1], fhalf[2], fhalf[3])` had NaNs, whereas `input.array()` did not have any NaNs. This seems to be due to an ArrayFire 3.6.1 bug: - issue: arrayfire/arrayfire#2273 - PR: arrayfire/arrayfire#2311 This diff applies the `af::moddims` workaround I mentioned in the issue. It does appear to be resolved in ArrayFire 3.6.2. But we can use this workaround until we update ArrayFire in TP2 to 3.6.2. Reviewed By: vineelpratap Differential Revision: D14961937 fbshipit-source-id: dcd455b82e7ce6888a2d35cba868718a55789f04
jacobkahn
pushed a commit
to flashlight/text
that referenced
this pull request
Mar 25, 2022
Summary: When testing CUDA ForceAlign, I encountered NaNs that seemed unrelated to ForceAlign. After investigation I discovered the NaNs were introduced during GLU. During one particular forward pass, in one particular GLU layer, the array `input.array()(fhalf[0], fhalf[1], fhalf[2], fhalf[3])` had NaNs, whereas `input.array()` did not have any NaNs. This seems to be due to an ArrayFire 3.6.1 bug: - issue: arrayfire/arrayfire#2273 - PR: arrayfire/arrayfire#2311 This diff applies the `af::moddims` workaround I mentioned in the issue. It does appear to be resolved in ArrayFire 3.6.2. But we can use this workaround until we update ArrayFire in TP2 to 3.6.2. Reviewed By: vineelpratap Differential Revision: D14961937 fbshipit-source-id: dcd455b82e7ce6888a2d35cba868718a55789f04
jacobkahn
pushed a commit
to flashlight/text
that referenced
this pull request
Mar 25, 2022
Summary: When testing CUDA ForceAlign, I encountered NaNs that seemed unrelated to ForceAlign. After investigation I discovered the NaNs were introduced during GLU. During one particular forward pass, in one particular GLU layer, the array `input.array()(fhalf[0], fhalf[1], fhalf[2], fhalf[3])` had NaNs, whereas `input.array()` did not have any NaNs. This seems to be due to an ArrayFire 3.6.1 bug: - issue: arrayfire/arrayfire#2273 - PR: arrayfire/arrayfire#2311 This diff applies the `af::moddims` workaround I mentioned in the issue. It does appear to be resolved in ArrayFire 3.6.2. But we can use this workaround until we update ArrayFire in TP2 to 3.6.2. Reviewed By: vineelpratap Differential Revision: D14961937 fbshipit-source-id: dcd455b82e7ce6888a2d35cba868718a55789f04
jacobkahn
pushed a commit
to flashlight/text
that referenced
this pull request
Mar 25, 2022
Summary: When testing CUDA ForceAlign, I encountered NaNs that seemed unrelated to ForceAlign. After investigation I discovered the NaNs were introduced during GLU. During one particular forward pass, in one particular GLU layer, the array `input.array()(fhalf[0], fhalf[1], fhalf[2], fhalf[3])` had NaNs, whereas `input.array()` did not have any NaNs. This seems to be due to an ArrayFire 3.6.1 bug: - issue: arrayfire/arrayfire#2273 - PR: arrayfire/arrayfire#2311 This diff applies the `af::moddims` workaround I mentioned in the issue. It does appear to be resolved in ArrayFire 3.6.2. But we can use this workaround until we update ArrayFire in TP2 to 3.6.2. Reviewed By: vineelpratap Differential Revision: D14961937 fbshipit-source-id: dcd455b82e7ce6888a2d35cba868718a55789f04
jacobkahn
pushed a commit
to flashlight/sequence
that referenced
this pull request
Oct 13, 2022
Summary: When testing CUDA ForceAlign, I encountered NaNs that seemed unrelated to ForceAlign. After investigation I discovered the NaNs were introduced during GLU. During one particular forward pass, in one particular GLU layer, the array `input.array()(fhalf[0], fhalf[1], fhalf[2], fhalf[3])` had NaNs, whereas `input.array()` did not have any NaNs. This seems to be due to an ArrayFire 3.6.1 bug: - issue: arrayfire/arrayfire#2273 - PR: arrayfire/arrayfire#2311 This diff applies the `af::moddims` workaround I mentioned in the issue. It does appear to be resolved in ArrayFire 3.6.2. But we can use this workaround until we update ArrayFire in TP2 to 3.6.2. Reviewed By: vineelpratap Differential Revision: D14961937 fbshipit-source-id: dcd455b82e7ce6888a2d35cba868718a55789f04
jacobkahn
pushed a commit
to flashlight/sequence
that referenced
this pull request
Oct 13, 2022
Summary: When testing CUDA ForceAlign, I encountered NaNs that seemed unrelated to ForceAlign. After investigation I discovered the NaNs were introduced during GLU. During one particular forward pass, in one particular GLU layer, the array `input.array()(fhalf[0], fhalf[1], fhalf[2], fhalf[3])` had NaNs, whereas `input.array()` did not have any NaNs. This seems to be due to an ArrayFire 3.6.1 bug: - issue: arrayfire/arrayfire#2273 - PR: arrayfire/arrayfire#2311 This diff applies the `af::moddims` workaround I mentioned in the issue. It does appear to be resolved in ArrayFire 3.6.2. But we can use this workaround until we update ArrayFire in TP2 to 3.6.2. Reviewed By: vineelpratap Differential Revision: D14961937 fbshipit-source-id: dcd455b82e7ce6888a2d35cba868718a55789f04
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This addresses #2273, and is a change of approach from the original PR #2303, since the problem doesn't lie in
reorder
itself, but in indexing (one of the tests in that PR was wrong too, which led me to believe that I was initially going the right direction there). This is a special case of reordering (or in general, modifying the dims/strides of) an array before indexing it, and more specifically using anaf::array
to index. For calculating the input offsets, indexing (on all backends) callsrc/backend/common/ArrayInfo.cpp:toStride
, which calculates the input stride based on theseqs
given, but the givenaf::array
index is not anaf::seq
object, and thus produces the wrong input strides. To get the correct strides (the result of theArray::modStrides
call within the internalreorder
), I think that we should use theParam/Array::strides
function instead.Please feel free to suggest any better approaches that you might think of.