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

[trivial] Fix OperatorTests::insertTensorTest #3337

Closed
wants to merge 1 commit into from

Conversation

nickgg
Copy link
Contributor

@nickgg nickgg commented Jul 31, 2019

Summary: In OperatorTests::insertTensorTests the insertTensor is getting optimized out because all inputs are constant splats. Changing them to Placeholders not known at compile time fixes this.

Documentation: n/a

Test Plan: unit tests, added printfs to libjit_insert_tensor to verify that the InsertTensorInst is in the final product.

Copy link
Contributor

@jfix71 jfix71 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@@ -6986,18 +6986,17 @@ TEST_P(OperatorTest, SigmoidCrossEntropyWithLogits) {
TEST_P(OperatorTest, insertTensorTest) {
ENABLED_BACKENDS(Interpreter, CPU);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: seems like OpenCL also has InsertTensor instr support, could just add that as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenCL has insertTensor but only for FP32 and Int8 - this test covers Int64. So it's right to be disabled.

The concatTests optimize down to InsertTensors so the OCL code path is covered by OperatorTests.

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickgg has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

@nickgg merged this pull request in 94d10eb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants