-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Replaced CHECK_ by TORCH_CHECK_ #6322
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
Conversation
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.
LGTM, thanks!
Yes, it is related as these jobs are still installing yesterday's pytorch nightly where |
Summary: Pull Request resolved: #2582 CHECK_ were deprecated in upstream so we should replace them here as well Similar to pytorch/vision#6322, relates to pytorch/pytorch#82032 Signed-off-by: Eli Uriegas <[email protected]> Test Plan: Imported from OSS Reviewed By: malfet, mthrok Differential Revision: D38208356 Pulled By: seemethere fbshipit-source-id: 6f42d517362f415e0775803514eee2628402918f
Summary: Pull Request resolved: pytorch#2582 CHECK_ were deprecated in upstream so we should replace them here as well Similar to pytorch/vision#6322, relates to pytorch/pytorch#82032 Signed-off-by: Eli Uriegas <[email protected]> Test Plan: Imported from OSS Reviewed By: malfet, mthrok Differential Revision: D38208356 Pulled By: seemethere fbshipit-source-id: 6f42d517362f415e0775803514eee2628402918f
Reviewed By: NicolasHug Differential Revision: D38351759 fbshipit-source-id: 33baf079eb49590752d73bd37d0d37edb1ec87f4
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.
Here is how TORCH_CHECK_* is defined:
#include <glog/logging.h>
// Additional macros on top of glog
#ifndef NDEBUG
#define TORCH_CHECK_EQ(val1, val2) CHECK_EQ(val1, val2)
#else // !NDEBUG
// These versions generate no code in optimized mode.
#define TORCH_CHECK_EQ(val1, val2) \
while (false) \
CHECK_EQ(val1, val2)
#endif // NDEBUG
This PR broke FB internals. It seems that the real cause of the problem is the change on the semantics/behaviour of *CHECK*
on Core. See pytorch/pytorch#82032 (comment).
Regardless, to resolve the situation I'm issuing a forward fix at D38383266 on Phabricator and at #6357 on Github.
@@ -50,7 +50,7 @@ void gotFilesStats(std::vector<VideoFileStats>& stats) { | |||
fseek(f, 0, SEEK_END); | |||
std::vector<uint8_t> buffer(ftell(f)); | |||
rewind(f); | |||
CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | |||
TORCH_CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); |
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.
This is not just a check. This is a function call that must be performed and then checked for its output. Unfortunately the new TORCH_CHECK_EQ mechanism can skip completely the method call if not in debug mode. This means that the function call will never be done causing issues.
@@ -90,7 +90,7 @@ size_t measurePerformanceUs( | |||
fseek(f, 0, SEEK_END); | |||
std::vector<uint8_t> buffer(ftell(f)); | |||
rewind(f); | |||
CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | |||
TORCH_CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); |
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.
another one
@@ -324,7 +324,7 @@ TEST(SyncDecoder, TestMemoryBuffer) { | |||
fseek(f, 0, SEEK_END); | |||
std::vector<uint8_t> buffer(ftell(f)); | |||
rewind(f); | |||
CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | |||
TORCH_CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); |
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.
this one too
@@ -349,7 +349,7 @@ TEST(SyncDecoder, TestMemoryBufferNoSeekableWithFullRead) { | |||
fseek(f, 0, SEEK_END); | |||
std::vector<uint8_t> buffer(ftell(f)); | |||
rewind(f); | |||
CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | |||
TORCH_CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); |
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.
this one too
@@ -388,7 +388,7 @@ TEST(SyncDecoder, TestMemoryBufferNoSeekableWithPartialRead) { | |||
fseek(f, 0, SEEK_END); | |||
std::vector<uint8_t> buffer(ftell(f)); | |||
rewind(f); | |||
CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | |||
TORCH_CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); |
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.
this one too
Summary: Resolves https://www.internalfb.com/tasks/?t=128004042 Caused by TorchVision's PR at #6322 which was in response to a change on PyTorch Core at pytorch/pytorch#82032 Reviewed By: fmassa Differential Revision: D38383266 fbshipit-source-id: 3f0ebd04a610031c4720123d1869a851f76455cd
Summary: Resolves https://www.internalfb.com/tasks/?t=128004042 Caused by TorchVision's PR at pytorch#6322 which was in response to a change on PyTorch Core at pytorch/pytorch#82032 Reviewed By: fmassa Differential Revision: D38383266 fbshipit-source-id: 3f0ebd04a610031c4720123d1869a851f76455cd
Summary: Resolves https://www.internalfb.com/tasks/?t=128004042 Caused by TorchVision's PR at #6322 which was in response to a change on PyTorch Core at pytorch/pytorch#82032 Reviewed By: fmassa Differential Revision: D38383266 fbshipit-source-id: 3f0ebd04a610031c4720123d1869a851f76455cd
Try to fix failing CI
Related pytorch PR: pytorch/pytorch#82032
CUDA CI jobs are failing as they still install 1.13.0.dev20220726 but CPU CI jobs are already running on 1.13.0.dev20220727
-> Check https://anaconda.org/pytorch-nightly/pytorch/files
-> Restart failing CI jobs only