Skip to content

Fix cl.exe detection in cpu/fused_kernel.cpp - #50085

Closed
skyline75489 wants to merge 1 commit into
pytorch:masterfrom
skyline75489:chesterliu/dev/jit-find-cl
Closed

skyline75489 wants to merge 1 commit into
pytorch:masterfrom
skyline75489:chesterliu/dev/jit-find-cl

Conversation

@skyline75489

@skyline75489 skyline75489 commented Jan 5, 2021 •

Copy link
Copy Markdown
Contributor

The command used here is essentially where cl.exe. By using system() we will not be able to find cl.exe unless we are using VS Developer Prompt, which makes activate() meaningless. Change system() to run() fixes this.

Found during #49781.

@facebook-github-bot facebook-github-bot added cla signed oncall: jit Add this issue/PR to JIT oncall triage queue labels Jan 5, 2021
@facebook-github-bot

facebook-github-bot commented Jan 5, 2021 •

Copy link
Copy Markdown
Contributor

💊 CI failures summary and remediations

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


✅ None of the CI failures appear to be your fault 💚



1 job timed out:

  • pytorch_linux_bionic_py3_8_gcc9_coverage_test1

🚧 1 fixed upstream failure:

These were probably caused by upstream breakages that were already fixed.

Please rebase on the viable/strict branch (expand for instructions)

If your commit is older than viable/strict, run these commands:

git fetch https://github.com/pytorch/pytorch viable/strict
git rebase FETCH_HEAD

Check out the recency history of this "viable master" tracking branch.


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.

This comment has been revised 4 times.

@ezyang

ezyang commented Jan 5, 2021

Copy link
Copy Markdown
Contributor

Any way to get test coverage for this?

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

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.

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

@skyline75489

Copy link
Copy Markdown
Contributor Author

Any way to get test coverage for this?

I dunno. There’s similar code below for “runCompiler”. I assume on Windows the CI is under the correct VS env, since no one found this before. It’d be hard for me mock a non-VS env.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@ezyang merged this pull request in 2ac180a.

@peterjc123

Copy link
Copy Markdown
Collaborator

@skyline75489 Could you please tell me the reason? It runs okay locally at my side.

@skyline75489

skyline75489 commented Jan 7, 2021 •

Copy link
Copy Markdown
Contributor Author

So basically i am using a env without cl.exe available. I found the activate() code which delibrately activate the VS env for compiling. But the programExists() isn't using the env_list. I cannot succesfully run the test cases cuz of this. Note that in the original logic, if programExists() returns false, cxx will be set to an empty string sliently without error information. The command being executed became /nologo /MD /O2 , which really makes no sense to users.

With this fix, i can finally run the test cases.

@skyline75489

Copy link
Copy Markdown
Contributor Author

The runCompiler is also using run() on Windows instead of system(). So i think someone just forgot to copy the logic into programExists.

hwangdeyu pushed a commit to hwangdeyu/pytorch that referenced this pull request Jan 14, 2021
Summary:
The command used here is essentially `where cl.exe`. By using `system()` we will not be able to find cl.exe unless we are using VS Developer Prompt, which makes `activate()` meaningless. Change `system()` to `run()` fixes this.

Found during pytorch#49781.

Pull Request resolved: pytorch#50085

Reviewed By: smessmer

Differential Revision: D25782054

Pulled By: ezyang

fbshipit-source-id: e8e3cac903a73f3bd78def667ebe0e93201814c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed Merged oncall: jit Add this issue/PR to JIT oncall triage queue open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants