-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Aten: catch2gtest #11846
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
Aten: catch2gtest #11846
Conversation
goldsborough
left a comment
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.
Good start, but please fix the naming and use of EXPECT_*
aten/src/ATen/test/apply_test.cpp
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
aten/src/ATen/test/apply_test.cpp
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
aten/src/ATen/test/apply_test.cpp
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Seeking for help: It seems there are some cuda-memory leaking problems when testing, and yet I have not figure out why. This error only happens in linux-xenial-cuda environment, and only in one test case: basic. The CPU test of basic is fine. After commented all testcases in CUDA test of basic (see commit "basic test 2"), it works well. But even only left one line in CUDA test ( like set a random seed, manual_seed(123, at::kCUDA) ), the error would occur. Thanks! |
aten/src/ATen/test/basic.cpp
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@zrphercule When you say leak problems, do you mean this error? Valgrind is choking for a very different reason: it's hitting an unrecognized instruction. 0xF 0xC7 is RDRAND https://en.wikipedia.org/wiki/RdRand and it is known to not be supported on some versions of valgrind. One way to fix this problem is try to install a newer version of valgrind on these servers. |
Aha, I thought it was because of memory leaking > < |
ezyang
left a comment
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.
Don't forget to update the commit message so that it accurately describes the current changes.
facebook-github-bot
left a comment
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.
zrphercule is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: migrant all tests in aten to use gtest except of basic.cpp Sinc features of gtest are different from catch test, some of the tests has been re-writted with similar meaning. Basic test has some version conflict with valgrind according to CI, therefore this testcase is still implementing catch. It will be resolved by a different pr. Pull Request resolved: pytorch/pytorch#11846 Differential Revision: D10080860 Pulled By: zrphercule fbshipit-source-id: 439d4cf33fb6ccbe79b797860342853c63e59081
Summary: In our #better-engineering quest of removing all uses of catch in favor of gtest, this PR ports JIT tests to gtest. After pytorch#11846 lands, we will be able to delete catch. I don't claim to use/write these tests much (though I wrote the custom operator tests) so please do scrutinize whether you will want to write tests in the way I propose. Basically: 1. One function declaration per "test case" in test/cpp/jit/test.h 2. One definition in test/cpp/jit/test.cpp 3. If you want to be able to run it in Python, add it to `runJitTests()` which is called from Python tests 4. If you want to be able to run it in C++, add a `JIT_TEST` line in test/cpp/jit/gtest.cpp Notice also I was able to share support code between C++ frontend and JIT tests, which is healthy. ezyang apaszke zdevito Pull Request resolved: pytorch#12030 Differential Revision: D10207745 fbshipit-source-id: c1e7d55d05840943bb2f92aa207082e836009416
Summary: In our #better-engineering quest of removing all uses of catch in favor of gtest, this PR ports JIT tests to gtest. After #11846 lands, we will be able to delete catch. I don't claim to use/write these tests much (though I wrote the custom operator tests) so please do scrutinize whether you will want to write tests in the way I propose. Basically: 1. One function declaration per "test case" in test/cpp/jit/test.h 2. One definition in test/cpp/jit/test.cpp 3. If you want to be able to run it in Python, add it to `runJitTests()` which is called from Python tests 4. If you want to be able to run it in C++, add a `JIT_TEST` line in test/cpp/jit/gtest.cpp Notice also I was able to share support code between C++ frontend and JIT tests, which is healthy. ezyang apaszke zdevito Pull Request resolved: #12030 Differential Revision: D10207745 Pulled By: goldsborough fbshipit-source-id: d4bae087e4d03818b72b8853cd5802d79a4cf32e
Summary: In #11846 , we immigranted all catch tests in Aten/test/ to use gtest except of basic.cpp for a GPU bug (valgrind related). In this PR, we will find out what the bug is, and immigrant last piece of aten catch to use gtest. Pull Request resolved: #12142 Differential Revision: D12946980 Pulled By: zrphercule fbshipit-source-id: cf3b21f23ddec3e363ac8ec4bdeb4bc4fe35f83b
migrant all tests in aten to use gtest except of basic.cpp
Sinc features of gtest are different from catch test, some of the tests has been re-writted with similar meaning.
Basic test has some version conflict with valgrind according to CI, therefore this testcase is still implementing catch.
It will be resolved by a different pr.