Skip to content

Remove use_c10_dispatcher option#54969

Closed
wenleix wants to merge 6 commits intogh/wenleix/14/basefrom
gh/wenleix/14/head
Closed

Remove use_c10_dispatcher option#54969
wenleix wants to merge 6 commits intogh/wenleix/14/basefrom
gh/wenleix/14/head

Conversation

@wenleix
Copy link
Copy Markdown
Contributor

@wenleix wenleix commented Mar 30, 2021

Stack from ghstack:

With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.

Differential Revision: D27436596

With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.

Differential Revision: [D27436596](https://our.internmc.facebook.com/intern/diff/D27436596/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Mar 30, 2021

💊 CI failures summary and remediations

As of commit eddd659 (more details on the Dr. CI page):


  • 4/4 failures introduced in this PR

🕵️ 3 new failures recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_libtorch_linux_xenial_cuda11_1_cudnn8_py3_gcc7_build (1/3)

Step: "Build" (full log | diagnosis details | 🔁 rerun)

Mar 31 23:14:44 CMake Error at android/libs/fbjni/CMakeLists.txt:15 (cmake_minimum_required):
Mar 31 23:14:44 CMake Warning at CMakeLists.txt:891 (message):
Mar 31 23:14:44   Generated cmake files are only fully tested if one builds with system glog,
Mar 31 23:14:44   gflags, and protobuf.  Other settings may generate files that are not well
Mar 31 23:14:44   tested.
Mar 31 23:14:44 
Mar 31 23:14:44 
Mar 31 23:14:44 -- BUILD_LITE_INTERPRETER (pytorch_jni_lite): OFF
Mar 31 23:14:44 -- ANDROID_STL:
Mar 31 23:14:44 -- TRACE_ENABLED OFF
Mar 31 23:14:44 -- libtorch dir:
Mar 31 23:14:44 CMake Error at android/libs/fbjni/CMakeLists.txt:15 (cmake_minimum_required):
Mar 31 23:14:44   CMake 3.6.0 or higher is required.  You are running version 3.5.1
Mar 31 23:14:44 
Mar 31 23:14:44 
Mar 31 23:14:44 -- Configuring incomplete, errors occurred!
Mar 31 23:14:44 See also "/var/lib/jenkins/cpp-build/caffe2/build/CMakeFiles/CMakeOutput.log".
Mar 31 23:14:44 See also "/var/lib/jenkins/cpp-build/caffe2/build/CMakeFiles/CMakeError.log".
Mar 31 23:14:44 cmake -DBUILD_ENVIRONMENT=pytorch-libtorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7-build -DBUILD_JNI=ON -DBUILD_PYTHON=False -DBUILD_SPLIT_CUDA=ON -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/var/lib/jenkins/workspace/torch -DCMAKE_PREFIX_PATH=/opt/conda/lib/python3.6/site-packages -DCUDA_NVCC_EXECUTABLE=/opt/cache/lib/nvcc -DJAVA_HOME=/usr/local -DNUMPY_INCLUDE_DIR=/opt/conda/lib/python3.6/site-packages/numpy/core/include -DPYTHON_EXECUTABLE=/opt/conda/bin/python -DPYTHON_INCLUDE_DIR=/opt/conda/include/python3.6m -DUSE_LLVM=/opt/llvm -DUSE_NUMPY=True -DWERROR=1 /var/lib/jenkins/workspace
Mar 31 23:14:44 Traceback (most recent call last):
Mar 31 23:14:44   File "/var/lib/jenkins/workspace/tools/build_libtorch.py", line 20, in <module>
Mar 31 23:14:44     rerun_cmake=True, cmake_only=False, cmake=CMake())

See CircleCI build docker-pytorch-linux-bionic-rocm4.0.1-py3.6 (2/3)

Step: "Check if image should be built" (full log | diagnosis details | 🔁 rerun)

ERROR: Something has gone wrong and the previous image isn't available for the merge-base of your branch
+ docker manifest inspect 308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-bionic-rocm4.0.1-py3.6:d8719dac6f8a78827639b78db6f7412f8570a0d7
no such manifest: 308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-bionic-rocm4.0.1-py3.6:d8719dac6f8a78827639b78db6f7412f8570a0d7
++ git merge-base HEAD 6473001b65088b41b986828ffdbdfc4abafaf50b
+ git rev-parse 6473001b65088b41b986828ffdbdfc4abafaf50b:.circleci/docker
d8719dac6f8a78827639b78db6f7412f8570a0d7
+++ git merge-base HEAD 6473001b65088b41b986828ffdbdfc4abafaf50b
++ git rev-parse 6473001b65088b41b986828ffdbdfc4abafaf50b:.circleci/docker
+ PREVIOUS_DOCKER_TAG=d8719dac6f8a78827639b78db6f7412f8570a0d7
+ [[ d8719dac6f8a78827639b78db6f7412f8570a0d7 = \d\8\7\1\9\d\a\c\6\f\8\a\7\8\8\2\7\6\3\9\b\7\8\d\b\6\f\7\4\1\2\f\8\5\7\0\a\0\d\7 ]]
+ echo 'ERROR: Something has gone wrong and the previous image isn'\''t available for the merge-base of your branch'
ERROR: Something has gone wrong and the previous image isn't available for the merge-base of your branch
+ echo '       contact the PyTorch team to restore the original images'
       contact the PyTorch team to restore the original images
+ exit 1


Exited with code exit status 1

See CircleCI build pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-build-x86_32 (3/3)

Step: "pytorch android gradle build only x86_32 (for PR)" (full log | diagnosis details | 🔁 rerun)

Mar 31 23:16:13 2021-03-31T23:15:07.986+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
Mar 31 23:16:13 2021-03-31T23:15:07.423+0000 [DEBUG] [org.gradle.internal.component.model.LoggingAttributeMatchingExplanationBuilder] Candidate androidx.loader:loader:1.0.0 doesn't match attributes {activity=base, artifactType=android-exploded-aar, build=local, com.android.build.api.attributes.BuildTypeAttr=release, model=resnet18, org.gradle.usage=java-api}
Mar 31 23:16:13 2021-03-31T23:15:07.423+0000 [DEBUG] [org.gradle.internal.component.model.LoggingAttributeMatchingExplanationBuilder] Candidate androidx.loader:loader:1.0.0 doesn't match attributes {activity=base, artifactType=android-exploded-aar, build=local, com.android.build.api.attributes.BuildTypeAttr=release, model=resnet18, org.gradle.usage=java-api}
Mar 31 23:16:13 2021-03-31T23:15:07.423+0000 [DEBUG] [org.gradle.internal.component.model.LoggingAttributeMatchingExplanationBuilder] Candidate androidx.viewpager:viewpager:1.0.0 doesn't match attributes {activity=base, artifactType=android-exploded-aar, build=local, com.android.build.api.attributes.BuildTypeAttr=release, model=resnet18, org.gradle.usage=java-api}
Mar 31 23:16:13 2021-03-31T23:15:07.423+0000 [DEBUG] [org.gradle.internal.component.model.LoggingAttributeMatchingExplanationBuilder] Candidate androidx.coordinatorlayout:coordinatorlayout:1.0.0 doesn't match attributes {activity=base, artifactType=android-exploded-aar, build=local, com.android.build.api.attributes.BuildTypeAttr=release, model=resnet18, org.gradle.usage=java-api}
Mar 31 23:16:13 2021-03-31T23:15:07.423+0000 [DEBUG] [org.gradle.internal.component.model.LoggingAttributeMatchingExplanationBuilder] Candidate androidx.drawerlayout:drawerlayout:1.0.0 doesn't match attributes {activity=base, artifactType=android-exploded-aar, build=local, com.android.build.api.attributes.BuildTypeAttr=release, model=resnet18, org.gradle.usage=java-api}
Mar 31 23:16:13 2021-03-31T23:15:07.423+0000 [DEBUG] [org.gradle.internal.component.model.LoggingAttributeMatchingExplanationBuilder] Candidate androidx.slidingpanelayout:slidingpanelayout:1.0.0 doesn't match attributes {activity=base, artifactType=android-exploded-aar, build=local, com.android.build.api.attributes.BuildTypeAttr=release, model=resnet18, org.gradle.usage=java-api}
Mar 31 23:16:13 2021-03-31T23:15:07.423+0000 [DEBUG] [org.gradle.internal.component.model.LoggingAttributeMatchingExplanationBuilder] Candidate androidx.customview:customview:1.0.0 doesn't match attributes {activity=base, artifactType=android-exploded-aar, build=local, com.android.build.api.attributes.BuildTypeAttr=release, model=resnet18, org.gradle.usage=java-api}
Mar 31 23:16:13 2021-03-31T23:15:07.423+0000 [DEBUG] [org.gradle.internal.component.model.LoggingAttributeMatchingExplanationBuilder] Candidate androidx.customview:customview:1.0.0 doesn't match attributes {activity=base, artifactType=android-exploded-aar, build=local, com.android.build.api.attributes.BuildTypeAttr=release, model=resnet18, org.gradle.usage=java-api}
Mar 31 23:16:13 2021-03-31T23:15:07.423+0000 [DEBUG] [org.gradle.internal.component.model.LoggingAttributeMatchingExplanationBuilder] Candidate androidx.customview:customview:1.0.0 doesn't match attributes {activity=base, artifactType=android-exploded-aar, build=local, com.android.build.api.attributes.BuildTypeAttr=release, model=resnet18, org.gradle.usage=java-api}
Mar 31 23:16:13 2021-03-31T23:15:07.423+0000 [DEBUG] [org.gradle.internal.component.model.LoggingAttributeMatchingExplanationBuilder] Candidate androidx.customview:customview:1.0.0 doesn't match attributes {activity=base, artifactType=android-exploded-aar, build=local, com.android.build.api.attributes.Bu2021-03-31T23:15:07.986+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
Mar 31 23:16:13 2021-03-31T23:15:07.986+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
Mar 31 23:16:13 2021-03-31T23:15:07.987+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
Mar 31 23:16:13 2021-03-31T23:15:07.987+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
Mar 31 23:16:13 2021-03-31T23:15:07.988+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':pytorch_android:generateJsonModelRelease'.
Mar 31 23:16:13 2021-03-31T23:15:07.988+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > exception while building Json $Could not resolve all files for configuration ':pytorch_android:_internal_prefab_binary'.
Mar 31 23:16:13 2021-03-31T23:15:07.988+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
Mar 31 23:16:13 2021-03-31T23:15:07.988+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
Mar 31 23:16:13 2021-03-31T23:15:07.988+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  Run with --scan to get full insights.
Mar 31 23:16:13 2021-03-31T23:15:07.989+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
Mar 31 23:16:13 2021-03-31T23:15:07.989+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
Mar 31 23:16:13 2021-03-31T23:15:07.990+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':pytorch_android:generateJsonModelRelease'.

1 failure not recognized by patterns:

Job Step Action
GitHub Actions clang-tidy Unknown 🔁 rerun

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.

Differential Revision: [D27436596](https://our.internmc.facebook.com/intern/diff/D27436596/)

[ghstack-poisoned]
wenleix pushed a commit that referenced this pull request Mar 30, 2021
Pull Request resolved: #54969

With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.
ghstack-source-id: 125269241

Differential Revision: [D27436596](https://our.internmc.facebook.com/intern/diff/D27436596/)
With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.

Differential Revision: [D27436596](https://our.internmc.facebook.com/intern/diff/D27436596/)

[ghstack-poisoned]
wenleix pushed a commit that referenced this pull request Mar 30, 2021
Pull Request resolved: #54969

With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.
ghstack-source-id: 125278882

Differential Revision: [D27436596](https://our.internmc.facebook.com/intern/diff/D27436596/)
With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.

Differential Revision: [D27436596](https://our.internmc.facebook.com/intern/diff/D27436596/)

[ghstack-poisoned]
wenleix pushed a commit that referenced this pull request Mar 31, 2021
Pull Request resolved: #54969

With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.
ghstack-source-id: 125341486

Differential Revision: [D27436596](https://our.internmc.facebook.com/intern/diff/D27436596/)
@wenleix wenleix requested review from ezyang and smessmer March 31, 2021 04:44
namespace impl {

inline c10::optional<MemoryFormat>
check_tensor_options_and_extract_memory_format(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

check_tensor_options_and_extract_memory_format is still required. But not sure how to rename hacky_wrapper_for_legacy_signatures.h. Use adaption.h in this PR but let me know if there is any better suggestions. cc @smessmer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

check_tensor_options_and_extract_memory_format is actually a good example of another thing we need to get rid of; it's due to MemoryFormat being a separate argument in some JIT schema but also being specified in TensorOptions.

Copy link
Copy Markdown
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

wooooo


class Locals(threading.local):
use_c10_dispatcher: Optional[UseC10Dispatcher] = None
_locals = Locals()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like we can remove the whole Locals class, cc @ezyang did you want to use it for something else?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@wenleix and I chatted about it, and it might make sense to keep this around for a little bit, in case there's some other incremental refactoring we need to do (I don't think we're done, btw)

Copy link
Copy Markdown
Contributor Author

@wenleix wenleix Mar 31, 2021

Choose a reason for hiding this comment

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

Discussed this offline with @ezyang . Supporting dynamic scoping during codegen seems a useful feature (e.g. other refactor) , plus is not very much code.

Copy link
Copy Markdown
Contributor

@smessmer smessmer left a comment

Choose a reason for hiding this comment

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

Yay :) Stoked to finally get rid of hacky_wrapper

With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.

Differential Revision: [D27436596](https://our.internmc.facebook.com/intern/diff/D27436596/)

[ghstack-poisoned]
wenleix pushed a commit that referenced this pull request Mar 31, 2021
Pull Request resolved: #54969

With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.
ghstack-source-id: 125401584

Differential Revision: [D27436596](https://our.internmc.facebook.com/intern/diff/D27436596/)
With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.

Differential Revision: [D27436596](https://our.internmc.facebook.com/intern/diff/D27436596/)

[ghstack-poisoned]
wenleix pushed a commit that referenced this pull request Mar 31, 2021
Pull Request resolved: #54969

With all use cases to hacky wrapper removed, all kernels will be
dispatched with c10 full dispatcher.
ghstack-source-id: 125434790

Differential Revision: [D27436596](https://our.internmc.facebook.com/intern/diff/D27436596/)
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 70af5db.

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.

4 participants