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

[PyTorch] Fix pytorch build #3441

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .circleci/build.sh
Expand Up @@ -128,7 +128,6 @@ elif [[ "$CIRCLE_JOB" == "PYTORCH" ]]; then
source venv/bin/activate
git clone https://github.com/pytorch/pytorch.git --recursive
cd pytorch
git checkout 7f86fb8995d9990fe1eac5a18335523cb3da7f09
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious how did we get a build failure on a master if we have not updated pytorch sha before?

technically, as long as we pinned to a certain version of pytorch we should be fine build Glow and do not get spurious failures, but i might be missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the diff that caused this was a pytorch that changed tensor types in pytorch and in glow, there was a corresponding pytorch github pr but not a corresponding glow github pr so no way for failure to occur on master. I removed this sha here because basically the thought is that if glow is tracking pytorch master in fbcode it should be in open source also other wise this will happen. If anyone has alternative thoughts I'm open to it though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. I think this sounds good, it does not seem that build time increased a lot and anyway we track pytorch master in fbcode very close as you said.

pip install -r requirements.txt
python setup.py install
cd ${GLOW_DIR}
Expand Down
3 changes: 1 addition & 2 deletions torch_glow/src/PyTorchModelLoader.cpp
Expand Up @@ -526,8 +526,7 @@ PyTorchModelLoader::loadValue(const torch::jit::Value *value) {
RETURN_ERR_IF_NOT(value->isCompleteTensor(),
glow::strFormat("Value %s must have CompleteTensor type.",
value->debugNameBase().c_str()));
auto glowType =
ptTypeToGlowType(*value->type()->expect<at::TensorType>());
auto glowType = ptTypeToGlowType(*value->type()->expect<at::TensorType>());
glow::Placeholder *ph = F_.getParent()->createPlaceholder(
&glowType, "input", /*isTrainable*/ false);
RETURN_IF_ERR(addGlowNodeValue(value, ph->getOutput()));
Expand Down