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

Use clang++ from HIP SDK on Windows as a C++ compiler #2815

Merged
merged 26 commits into from
Mar 13, 2024
Merged

Conversation

apwojcik
Copy link
Collaborator

The c++ command for the C++ compiler is unavailable on Windows. In general, installed by default of any compiler on Windows is not the standard. We assume HIP SDK is installed in the system at least, so we can use that as the C++ compiler.
The installation directory of HIP SDK is provided through the HIP_PATH environment variable (the HIP SDK installer creates that variable).

@apwojcik apwojcik added the Windows Related changes for Windows Environments label Feb 22, 2024
@apwojcik apwojcik requested a review from pfultz2 February 22, 2024 19:25
@apwojcik apwojcik requested a review from causten as a code owner February 22, 2024 19:25
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 91.82%. Comparing base (f18b3ae) to head (3d08615).

Files Patch % Lines
src/compile_src.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2815   +/-   ##
========================================
  Coverage    91.82%   91.82%           
========================================
  Files          477      478    +1     
  Lines        18112    18115    +3     
========================================
+ Hits         16631    16634    +3     
  Misses        1481     1481           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pfultz2
Copy link
Collaborator

pfultz2 commented Feb 22, 2024

We should use whatever the CMAKE_CXX_COMPILER is set to by default on windows. I dont want to rely on setting environment variables to have tests work correctly.

@apwojcik
Copy link
Collaborator Author

apwojcik commented Feb 23, 2024

We should use whatever the CMAKE_CXX_COMPILER is set to by default on windows. I dont want to rely on setting environment variables to have tests work correctly.

We cannot rely on build system configuration for the production package. The reason is that compilers on Windows may be installed in nonstandard locations (usually they are; for instance, for our convenience, we are installing compilers at c:\opt\rocm and the HIP SDK installer by default at C:\Program Files\AMD\HIP... something).
The HIP SDK on Windows reveals its location by setting the HIP_PATH environment variable. Users may install to an arbitrary directory (the default is just a suggestion). Most of the tools do that, including MSVC. Alternatively, they may provide Windows registry entries with relevant information. So, we cannot rely on CMAKE_CXX_COMPILER on Windows because it will not match the deployment system - it is not only to pass tests.

@migraphx-bot
Copy link
Collaborator

migraphx-bot commented Feb 26, 2024

Test Batch Rate new
3d0861
Rate old
f18b3a
Diff Compare
torchvision-resnet50 64 2,851.92 2,852.01 -0.00%
torchvision-resnet50_fp16 64 6,517.30 6,516.75 0.01%
torchvision-densenet121 32 2,099.23 2,101.43 -0.10%
torchvision-densenet121_fp16 32 3,696.13 3,687.98 0.22%
torchvision-inceptionv3 32 1,603.52 1,604.91 -0.09%
torchvision-inceptionv3_fp16 32 2,579.23 2,574.13 0.20%
cadene-inceptionv4 16 724.84 724.85 -0.00%
cadene-resnext64x4 16 683.13 683.17 -0.01%
slim-mobilenet 64 5,946.91 5,935.54 0.19%
slim-nasnetalarge 64 152.80 152.89 -0.06%
slim-resnet50v2 64 2,668.15 nan nan%
bert-mrpc-onnx 8 918.39 919.16 -0.08%
bert-mrpc-tf 1 434.69 436.14 -0.33%
pytorch-examples-wlang-gru 1 418.02 423.38 -1.27%
pytorch-examples-wlang-lstm 1 400.91 388.56 3.18% 🔆
torchvision-resnet50_1 1 605.15 602.10 0.51%
cadene-dpn92_1 1 390.57 393.08 -0.64%
cadene-resnext101_1 1 332.26 332.15 0.03%
onnx-taau-downsample 1 305.53 305.99 -0.15%
dlrm-criteoterabyte 1 nan 28.74 nan%
dlrm-criteoterabyte_fp16 1 49.59 49.59 -0.01%
agentmodel 1 6,349.65 5,384.71 17.92% 🔆
unet_fp16 2 57.45 57.61 -0.28%
resnet50v1_fp16 1 873.04 884.99 -1.35%
resnet50v1_int8 1 789.88 797.72 -0.98%
bert_base_cased_fp16 64 1,055.68 1,055.63 0.00%
bert_large_uncased_fp16 32 311.98 311.88 0.03%
bert_large_fp16 1 159.30 159.36 -0.04%
distilgpt2_fp16 16 1,857.21 1,858.22 -0.05%
yolov5s 1 489.81 486.48 0.69%
tinyllama 1 32.86 32.85 0.03%
vicuna-fastchat 1 157.92 158.00 -0.05%
whisper-tiny-encoder 1 348.53 349.19 -0.19%
whisper-tiny-decoder 1 400.07 399.52 0.14%

This build is not recommended to merge 🔴

@migraphx-bot
Copy link
Collaborator

migraphx-bot commented Feb 26, 2024


     ✅ bert-mrpc-onnx: PASSED: MIGraphX meets tolerance

     ✅ bert-mrpc-tf: PASSED: MIGraphX meets tolerance

     ✅ pytorch-examples-wlang-gru: PASSED: MIGraphX meets tolerance

     ✅ pytorch-examples-wlang-lstm: PASSED: MIGraphX meets tolerance

     ✅ torchvision-resnet50_1: PASSED: MIGraphX meets tolerance

     ✅ cadene-dpn92_1: PASSED: MIGraphX meets tolerance

     ✅ cadene-resnext101_1: PASSED: MIGraphX meets tolerance

     ✅ dlrm-criteoterabyte: PASSED: MIGraphX meets tolerance

     ✅ agentmodel: PASSED: MIGraphX meets tolerance

     ✅ unet: PASSED: MIGraphX meets tolerance

     ✅ resnet50v1: PASSED: MIGraphX meets tolerance

     ✅ bert_base_cased_fp16: PASSED: MIGraphX meets tolerance

🔴bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output


     ✅ bert_large: PASSED: MIGraphX meets tolerance

     ✅ yolov5s: PASSED: MIGraphX meets tolerance

     ✅ tinyllama: PASSED: MIGraphX meets tolerance

     ✅ vicuna-fastchat: PASSED: MIGraphX meets tolerance

     ✅ whisper-tiny-encoder: PASSED: MIGraphX meets tolerance

     ✅ whisper-tiny-decoder: PASSED: MIGraphX meets tolerance

     ✅ distilgpt2_fp16: PASSED: MIGraphX meets tolerance

@pfultz2
Copy link
Collaborator

pfultz2 commented Feb 27, 2024

We cannot rely on build system configuration for the production package.

Yes of course, thats why we dont call to the compiler during the runtime, we use hipRTC for that(the option to use clang is for dev only).

The reason is that compilers on Windows may be installed in nonstandard locations

Compilers maybe installed in nonstandard locations on linux as well(it could be installed with a source-based package manager like spack) or not installed at all since its a dev package not a runtime package. This is why we compile with hipRTC.

The HIP SDK on Windows reveals its location by setting the HIP_PATH environment variable.

This variable wont be set if hip is installed with spack or vcpkg or built from source.

it is not only to pass tests.

I dont understand, the only place the c++ compiler is used is in a unit test. Its not used anywhere else.

@causten causten merged commit 4def653 into develop Mar 13, 2024
46 of 48 checks passed
@causten causten deleted the compile_src branch March 13, 2024 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Windows Related changes for Windows Environments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants