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

ROCm support #3462

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

iotamudelta
Copy link
Contributor

@iotamudelta iotamudelta commented May 20, 2024

  • add hipify at configure time
  • ROCm specific code paths behind USE_ROCM guards
  • support for wavefront 32 (Navi) and 64 (MI)
  • use builtins to match inline PTX
  • support C API on ROCm
  • support Python API on ROCm

* add hipify at configure time
* ROCm specific code paths behind USE_ROCM guards
* support for wavefront 32 (Navi) and 64 (MI)
* use builtins to match inline PTX
* support C API on ROCm
* disable Python API on ROCm for now

---------

Co-authored-by: Jeff Daily <jeff.daily@amd.com>
Co-authored-by: hubertlu-tw <hubertlu@amd.com>
Co-authored-by: Xinya Zhang <Xinya.Zhang@amd.com>
Co-authored-by: Michael Pittard <michael.pittard@amd.com>
@iotamudelta
Copy link
Contributor Author

This superseedes #3126 and addresses #3231

As discussed in #3231 , @ItsPitt (Michael Pittard) and @iotamudelta (myself) can maintain the ROCm backend. AMD can provide two MI200-class servers for CI with a similar arrangement to the PyTorch CI.

@iotamudelta
Copy link
Contributor Author

Given the size of the work and difficulty to review that, we'd be more than happy to split it up into smaller PRs based on feedback what such PRs should encompass. Thanks!

@mdouze
Copy link
Contributor

mdouze commented May 27, 2024

Assuming this is WIP because the Python tests are not there yet. Otherwise I can write them but could take some time.
Sorry for insisting but many people (especially in the ML community) know Faiss only via Python.

@iotamudelta
Copy link
Contributor Author

@mdouze thanks a lot for having a look! yes, we can figure out the Python support prior to getting it merged.

Are there any other immediate issues you see that we should be working on? Do you prefer getting this all merged as one big PR or split up (if so: how)?

Again - thanks a lot!

@mdouze
Copy link
Contributor

mdouze commented May 28, 2024

We are looking into compiling this in the CI
@ramilbakhshyiev

@iotamudelta
Copy link
Contributor Author

@mdouze we sorted the Python support out. I am not sure if the Windows CI target failing after my latest merge of main is real or not.

@ramilbakhshyiev anything we can help with w.r.t. getting this into CI? Thanks!

@ramilbakhshyiev
Copy link
Contributor

@iotamudelta We will be trying this soon, our plan is to use a g4ad instance from AWS. Once we try it on that, we will most likely come back with some feedback.

@iotamudelta
Copy link
Contributor Author

@ramilbakhshyiev I'm not sure g4ad will work - according to https://aws.amazon.com/ec2/instance-types/ , it features a AMD Radeon Pro V520 w/ RDNA1 architecture which is not supported by ROCm (see: https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html )

@ramilbakhshyiev
Copy link
Contributor

@iotamudelta Is there any plan to support it? I think AWS is a widely used platform and it only seems to support g4ad, right?

@iotamudelta
Copy link
Contributor Author

@ramilbakhshyiev I do not know about support plans. ROCm does support RDNA2 and RDNA3 GPUs.

@ramilbakhshyiev
Copy link
Contributor

Based on some of my very high-level research, it seems that some users still get ROCm on g4ad even though it's unsupported by AMD. Do you have any opinion on using that to build this in our CI? If we don't have an option to build and test on g4ad then I believe that our only option is to use CI only for builds.

@iotamudelta
Copy link
Contributor Author

@ramilbakhshyiev it's hard to answer this - building CI is must-have, I think. If we can get started with that, it'd be a huge step forward. We can try to test on the AWS instance but we cannot guarantee correctness, stability, or performance on it.

As stated earlier, we could also use two of the PyTorch CI MI200-class machines but it sounds that would be too much effort to integrate?

@ramilbakhshyiev
Copy link
Contributor

@iotamudelta Hey, apologies for missing that earlier offer, I missed that context when picking this up. I think getting AMD to provide backends would work great and I think we can support the integration. I have glanced through #3231 and PyTorch but did not figure out AMD servers register runners with GitHub. Any chance you can point me to that? I assume you're using PyTorch's GH App to retrieve API tokens and register runners to use.

@asadoughi asadoughi added the GPU label Jul 2, 2024
@ramilbakhshyiev
Copy link
Contributor

@iotamudelta Hey, apologies for missing that earlier offer, I missed that context when picking this up. I think getting AMD to provide backends would work great and I think we can support the integration. I have glanced through #3231 and PyTorch but did not figure out AMD servers register runners with GitHub. Any chance you can point me to that? I assume you're using PyTorch's GH App to retrieve API tokens and register runners to use.

@iotamudelta @ItsPitt

@ramilbakhshyiev
Copy link
Contributor

@ItsPitt I introduced the ENABLE_ROCM to be explicit to follow current patterns in the library. Happy to discuss now or when we have a PR to enable ROCm in CI.

I did add a step to call hipify.sh, the HIP module error still stayed. Can you please take a look and let me know if you have any thoughts? https://github.com/facebookresearch/faiss/actions/runs/9911542730/job/27384449480?pr=3622

@ItsPitt
Copy link

ItsPitt commented Jul 12, 2024

@ramilbakhshyiev It looks like it cannot find the hip cmake module. You should be able to resolve this by adding the following to the cmake file:

set(CMAKE_MODULE_PATH "/opt/rocm/hip/cmake" ${CMAKE_MODULE_PATH})

The line above find_package(HIP REQUIRED) so it's inside the if (USE_ROCM) should work.

@ItsPitt I introduced the ENABLE_ROCM to be explicit to follow current patterns in the library. Happy to discuss now or when we have a PR to enable ROCm in CI.

Understood, sounds good!

@ItsPitt
Copy link

ItsPitt commented Jul 12, 2024

Also, here is the documentation for including FindHIP. It has a few more examples: https://github.com/ROCm/HIP/tree/master/samples/2_Cookbook/12_cmake_hip_add_executable#including-findhip-cmake-module-in-the-project

@ramilbakhshyiev
Copy link
Contributor

Thanks @ItsPitt! I tried a few versions and it didn't solve the problem. Upon some investigating, I was only able to find FindHIP.cmake in /opt/rocm-6.1.0/lib/cmake/hip/ (searching under the full /opt path). Do you know why the install happens this way and what I should do about it? I am trying that specific path right now but it still seems pretty far from the path expected in the documentation.

@ramilbakhshyiev
Copy link
Contributor

Made it to the next step but it failed then:

-- Found MKL: /home/runner/miniconda3/lib/libmkl_rt.so;-lpthread;-lm;-ldl  
CMAKE_MODULE_PATH: = /home/runner/work/faiss/faiss/cmake
CMAKE_MODULE_PATH: = /opt/rocm-6.1.0/lib/cmake/hip/;/home/runner/work/faiss/faiss/cmake
-- Found HIP: /opt/rocm-6.1.0 (found version "6.1.40091-a8dbc0c19") 
CMake Error at /opt/rocm-6.1.0/lib/cmake/hip/FindHIP.cmake:299 (message):
  Unable to find the clang compiler path.  Set ROCM_PATH or HIP_PATH in env
Call Stack (most recent call first):
  faiss/gpu-rocm/CMakeLists.txt:325 (find_package)
-- Configuring incomplete, errors occurred!

@ItsPitt
Copy link

ItsPitt commented Jul 16, 2024

@ramilbakhshyiev I did some digging and was able to repo this. You just need to add -DCMAKE_PREFIX_PATH=/opt/rocm to your cmake build flags. Hope this helps!

@ramilbakhshyiev
Copy link
Contributor

Thanks @ItsPitt! It started building but now fails because it cannot find libm, I'm looking into it right now:

[ 79%] Linking HIP shared library libfaiss.so
clang++: warning: argument unused during compilation: '--offload-arch=gfx90a' [-Wunused-command-line-argument]
ld.lld: error: cannot open /lib64/libm.so.6: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

@ramilbakhshyiev
Copy link
Contributor

Hey @ItsPitt, I want to provide an update. libm is available under $CONDA_PREFIX/x86_64-conda-linux-gnu/sysroot/usr/lib64 on the runner machine but not directly in under /lib64. So far, I have tried to hint it to the linker with target_link_directories and CMAKE_PREFIX_PATH and now trying with updating the LD_LIBRARY_PATH. I have combed through the PR and not sure what breaks the library paths. If you have any thoughts or ideas, happy to try those.

@ItsPitt
Copy link

ItsPitt commented Jul 17, 2024

@ramilbakhshyiev I have not run into that issue before. However, I am setting LD_LIBRARY_PATH=/opt/rocm/lib in my docker. I'm not sure if that's the root of your issue, but I'll link my whole docker below. I hope this helps!

https://github.com/ItsPitt/faiss_docker/tree/rocm_wf64_wf32

@ramilbakhshyiev
Copy link
Contributor

@ItsPitt @iotamudelta I have some updates. I have been able to build this PR in CI but with some workarounds (some are pretty brute force): link to full diff. This includes rebase onto main but here are the main files to pay attention to:

  • .github/actions/build_cmake/action.yml: install ROCm, call hipify.sh, do not build tests and do not run tests for ROCm
  • CMakeLists.txt: use FAISS_USE_ROCM instead of existence of /opt/rocm for enabling ROCm
  • faiss/gpu/hipify.sh: symlink required libraries from conda install -- we can move this to the ROCm install section of action.yml above; otherwise, it would be great to hear ideas on how to avoid this
  • faiss/gpu/CMakeLists.txt: set CMAKE_PREFIX_PATH and CMAKE_MODULE_PATH, will remove messaging and LD_LIBRARY_PATH

Can you please review and let me know what you think? it's not ideal but at least we have a way to compile ROCm version.

Main questions:

  1. Any updates on ssh access to the machines you would provide? If not, we can proceed with you runner scripts that we send to you to register the runners.
  2. Should we be able to compile the testing code without having an AMD GPU on the host? It seemed to have failed for that reason.
  3. In your setup, does ROCm install into /opt/rocm or /opt/rocm-{version}? I wanted to understand why it's installed versioned in our case and why CMake files are in a different spot than what the documentation mentions.
  4. Do you have the list of libraries I symblinked in hipify.sh in /opt/rocm/lib? If yes, I will try to get the LD_LIBRARY_CONFIG updated in the CMake setup and use that.

If this is ok, I can review with the team if we are ok to proceed to rebase and review this PR to merge it in and then add the compile-only steps.

@ItsPitt
Copy link

ItsPitt commented Jul 19, 2024

@ramilbakhshyiev Glad to hear it's building!

  • CMakeLists.txt: use FAISS_USE_ROCM instead of existence of /opt/rocm for enabling ROCm

This makes sense. We could maybe enable gpu automatically if ROCm is enabled to avoid having to enable both. But this doesn't have to be done now.

  • faiss/gpu/hipify.sh: symlink required libraries from conda install -- we can move this to the ROCm install section of action.yml above; otherwise, it would be great to hear ideas on how to avoid this

Moving this to action.yml would probably be best in avoiding issues when building on other systems. Since other systems won't have this file path and still need to run this script.

  1. Any updates on ssh access to the machines you would provide? If not, we can proceed with you runner scripts that we send to you to register the runners.

I believe there's been some movement. I'll find out more details and get back to you on this.

  1. Should we be able to compile the testing code without having an AMD GPU on the host? It seemed to have failed for that reason.

I'll look into this and get you an answer. Of course, if the testing code tries to make a device call as some kinda validation during building, this would cause an issue. Not sure that's what's going on here, just something to check.

  1. In your setup, does ROCm install into /opt/rocm or /opt/rocm-{version}? I wanted to understand why it's installed versioned in our case and why CMake files are in a different spot than what the documentation mentions.

When ROCm installs, it makes the symbolic link /opt/rocm to /opt/rocm-{version}. The actual install will be in /opt/rocm-{version}. Using the link just lets a user avoid updating the version number whenever they update ROCm. But using either should work.

This also helps for installing multiple versions of ROCm:
https://rocm.blogs.amd.com/software-tools-optimization/rocm-installation/README.html

  1. Do you have the list of libraries I symblinked in hipify.sh in /opt/rocm/lib? If yes, I will try to get the LD_LIBRARY_CONFIG updated in the CMake setup and use that.

These look to be system libs and not part of ROCm.

@ramilbakhshyiev
Copy link
Contributor

@ItsPitt ack and thank you! I am currently trying to figure out the build errors with testing code, it actually seems to be failing to link against glib and also can't find one of the ROCm libs (I assume). Question on that: I assume AMD integrates into CMake/make setup, is that correct? Are there any recommended ways to debug why make does not find the libraries that it's looking for? I mean specific to ROCm/HIP setup.

@ItsPitt
Copy link

ItsPitt commented Jul 24, 2024

@ramilbakhshyiev Do you know which ROCm lib(s) it was failing to link against?

It is correct. Out of curiosity, do you know which version of CMake you're using? It might be best if we start synchronizing dependency versions to eliminate factors between the working docker and the conda build.

@ramilbakhshyiev
Copy link
Contributor

@ItsPitt We use CMake 3.26 and the library that it couldn't find was libamdhip64.so.6. I provided the excerpt with errors below. Not sure why conda install 3.26, I will try with the version you specify in the dockerfile you provided.

2024-07-18T22:46:20.0232041Z [ 98%] Linking HIP executable TestGpuDistance
2024-07-18T22:46:20.2657473Z ld.lld: error: undefined symbol: __libc_single_threaded
2024-07-18T22:46:20.2659015Z >>> referenced by TestGpuDistance.hip
2024-07-18T22:46:20.2660505Z >>>               CMakeFiles/TestGpuDistance.dir/TestGpuDistance.hip.o:(testTransposition(bool, bool, faiss::MetricType, bool, float))
2024-07-18T22:46:20.2661882Z >>> referenced by TestGpuDistance.hip
2024-07-18T22:46:20.2663202Z >>>               CMakeFiles/TestGpuDistance.dir/TestGpuDistance.hip.o:(testTransposition(bool, bool, faiss::MetricType, bool, float))
2024-07-18T22:46:20.2664489Z >>> referenced by TestGpuDistance.hip
2024-07-18T22:46:20.2665766Z >>>               CMakeFiles/TestGpuDistance.dir/TestGpuDistance.hip.o:(testTransposition(bool, bool, faiss::MetricType, bool, float))
2024-07-18T22:46:20.2667013Z >>> referenced 3 more times
2024-07-18T22:46:20.2706393Z clang++: error: linker command failed with exit code 1 (use -v to see invocation)
2024-07-18T22:46:20.2754798Z make[2]: *** [faiss/gpu-rocm/test/CMakeFiles/TestGpuDistance.dir/build.make:101: faiss/gpu-rocm/test/TestGpuDistance] Error 1
2024-07-18T22:46:20.2756387Z make[2]: Leaving directory '/home/runner/work/faiss/faiss/build'
2024-07-18T22:46:20.2758640Z make[2]: Target 'faiss/gpu-rocm/test/CMakeFiles/TestGpuDistance.dir/build' not remade because of errors.
2024-07-18T22:46:20.2760522Z make[1]: *** [CMakeFiles/Makefile2:2209: faiss/gpu-rocm/test/CMakeFiles/TestGpuDistance.dir/all] Error 2
2024-07-18T22:46:25.0384186Z [100%] Linking HIP executable TestGpuSelect
2024-07-18T22:46:25.0995353Z ld.lld: error: undefined symbol: __libc_single_threaded
2024-07-18T22:46:25.0996060Z >>> referenced by TestGpuSelect.hip
2024-07-18T22:46:25.0997162Z >>>               CMakeFiles/TestGpuSelect.dir/TestGpuSelect.hip.o:(testForSize(int, int, int, bool, bool))
2024-07-18T22:46:25.0998075Z >>> referenced by TestGpuSelect.hip
2024-07-18T22:46:25.0999176Z >>>               CMakeFiles/TestGpuSelect.dir/TestGpuSelect.hip.o:(testForSize(int, int, int, bool, bool))
2024-07-18T22:46:25.1000179Z >>> referenced by TestGpuSelect.hip
2024-07-18T22:46:25.1001209Z >>>               CMakeFiles/TestGpuSelect.dir/TestGpuSelect.hip.o:(testForSize(int, int, int, bool, bool))
2024-07-18T22:46:25.1002295Z >>> referenced 2 more times
2024-07-18T22:46:25.1037876Z clang++: error: linker command failed with exit code 1 (use -v to see invocation)
2024-07-18T22:46:25.1083260Z make[2]: *** [faiss/gpu-rocm/test/CMakeFiles/TestGpuSelect.dir/build.make:101: faiss/gpu-rocm/test/TestGpuSelect] Error 1
2024-07-18T22:46:25.1085674Z make[2]: Target 'faiss/gpu-rocm/test/CMakeFiles/TestGpuSelect.dir/build' not remade because of errors.
2024-07-18T22:46:25.1087147Z make[1]: *** [CMakeFiles/Makefile2:2237: faiss/gpu-rocm/test/CMakeFiles/TestGpuSelect.dir/all] Error 2
2024-07-18T22:46:25.1088279Z make[2]: Leaving directory '/home/runner/work/faiss/faiss/build'
2024-07-18T22:46:28.9987835Z [100%] Linking CXX executable faiss_test
2024-07-18T22:46:29.1223839Z /home/runner/work/faiss/faiss/build/tests/faiss_test: error while loading shared libraries: libamdhip64.so.6: cannot open shared object file: No such file or directory
2024-07-18T22:46:29.1229698Z CMake Error at /home/runner/miniconda3/share/cmake-3.26/Modules/GoogleTestAddTests.cmake:112 (message):
2024-07-18T22:46:29.1230847Z   Error running test executable.
2024-07-18T22:46:29.1231217Z 
2024-07-18T22:46:29.1232350Z     Path: '/home/runner/work/faiss/faiss/build/tests/faiss_test'
2024-07-18T22:46:29.1233055Z     Result: 127
2024-07-18T22:46:29.1233429Z     Output:
2024-07-18T22:46:29.1233756Z       
2024-07-18T22:46:29.1233969Z 
2024-07-18T22:46:29.1234149Z Call Stack (most recent call first):
2024-07-18T22:46:29.1235416Z   /home/runner/miniconda3/share/cmake-3.26/Modules/GoogleTestAddTests.cmake:225 (gtest_discover_tests_impl)
2024-07-18T22:46:29.1236371Z 
2024-07-18T22:46:29.1236378Z 
2024-07-18T22:46:29.1245951Z make[2]: *** [tests/CMakeFiles/faiss_test.dir/build.make:567: tests/faiss_test] Error 1

@ramilbakhshyiev
Copy link
Contributor

I tried with 3.24 cmake and got the same error. I saw a commit on the dockerfile you provided to lower the cmake version from 3.29 to 3.24. What was the reason for doing that?

Meanwhile I am trying to match more versions to see if it helps.

@ramilbakhshyiev
Copy link
Contributor

I think I got a working build. I will clean things up, test it again, and update you with what I needed to change.

@ItsPitt
Copy link

ItsPitt commented Jul 24, 2024

@ramilbakhshyiev Great to hear!

As for the CMake question, I hadn't fully validated the new version of CMake in my docker, so I rolled it back. No specific issue. It can more than likely be bumped once it's fully working.

Comment on lines 321 to 326
if (USE_ROCM)
find_package(HIP REQUIRED)
find_package(hipBLAS REQUIRED)
target_link_libraries(faiss_gpu PRIVATE hip::host roc::hipblas)
target_compile_options(faiss_gpu PRIVATE)
else()
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. indentation
  2. Can we please move find_package statements to the top-level CMakeLists.txt guarded by USE_ROCM?
  3. For target_link_libraries, can we please use the condition syntax like we do for RAFT? $<$<BOOL:${USE_ROCM}>:hip::host>

@@ -365,8 +365,8 @@ void StandardGpuResourcesImpl::initializeForDevice(int device) {

// Our code is pre-built with and expects warpSize == 32, validate that
FAISS_ASSERT_FMT(
prop.warpSize == 32,
"Device id %d does not have expected warpSize of 32",
prop.warpSize == 32 || prop.warpSize == 64,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this ROCm specific? If so, can we allow 64 only for ROCm?

Copy link

Choose a reason for hiding this comment

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

We have both wavefront 32 (E.g. navi) and 64 (E.g. MI250) devices. So this offers support for both.

Copy link
Contributor

Choose a reason for hiding this comment

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

It sounds like Nvidia is 32 only and ROCm is 32 or 64. Should we lock it accordingly in code?

Copy link

Choose a reason for hiding this comment

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

If that is desired, I could rework that assert using a ROCm flag to only allow a warpSize of 64 (and 32) on ROCm devices. It shouldn't be an issue at all!

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think I would do that.

Comment on lines 23 to 27
if(USE_ROCM)
find_package(HIP REQUIRED)
target_link_libraries(faiss_gpu_test_helper PUBLIC faiss gtest hip::host)
else()
find_package(CUDAToolkit REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above:

  1. Can we rely on top-level find package call?
  2. Can we use conditional inclusion like we do with RAFT?

Comment on lines 46 to 52
if(USE_ROCM)
faiss_gpu_test(TestGpuDistance.hip)
faiss_gpu_test(TestGpuSelect.hip)
else()
faiss_gpu_test(TestGpuDistance.cu)
faiss_gpu_test(TestGpuSelect.cu)

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use $HIP_OR_CU here?

Comment on lines 61 to 67
if (USE_ROCM)
target_link_libraries(demo_ivfpq_indexing_gpu
PRIVATE faiss gtest_main hip::host)
else()
target_link_libraries(demo_ivfpq_indexing_gpu
PRIVATE faiss gtest_main CUDA::cudart)
endif()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do conditional here please?

Comment on lines 142 to 147
if(USE_ROCM)
find_package(HIP REQUIRED)
target_link_libraries(swigfaiss PRIVATE hip::host)
target_link_libraries(swigfaiss_avx2 PRIVATE hip::host)
target_link_libraries(swigfaiss_avx512 PRIVATE hip::host)
else()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use conditional statements here and elsewhere in this file too?

@@ -197,6 +197,16 @@ function(generate_ivf_interleaved_code)
"64|2048|8"
)

if(USE_ROCM)
set(CU_OR_HIP "hip")
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you name it something like GPU_EXT_PREFIX?

@ramilbakhshyiev
Copy link
Contributor

@ItsPitt @iotamudelta I found a workaround to build the tests in our CI environment so I think we should be good for build-only setup for now. I left some initial comments on the PR. Can you please rebase as well? Once we address the comments, I will run the PR by the team and we will figure what else needs to happen so we could merge it. After that, I will publish the PR to enable build-only.

@ramilbakhshyiev
Copy link
Contributor

Here's a successful build with testing enabled: https://github.com/facebookresearch/faiss/actions/runs/10085927308/job/27887614699?pr=3622

@ItsPitt
Copy link

ItsPitt commented Jul 26, 2024

@ramilbakhshyiev I'll work on these changes and get back to you.

@ramilbakhshyiev
Copy link
Contributor

@ramilbakhshyiev I'll work on these changes and get back to you.

Sounds great, thank you!

@ItsPitt
Copy link

ItsPitt commented Jul 29, 2024

@ramilbakhshyiev I believe I address all issues. If there are more or I missed any, just let me know!

Fixed indentations.
Moved find_package to the top level CMake.
Changed all target_link_libraries for hip::host to $<$<BOOL:${USE_ROCM}>:hip::host>.
Changed the warpSize assert to allow a size of 64 only on ROCm. While allowing a size of 32 on all devices.
Moved $HIP_OR_CU to the top level CMake for use in faiss/gpu/CMakeLists.txt. Also changed the name to $GPU_EXT_PREFIX.
Replaced file extensions (such as .hip) with $GPU_EXT_PREFIX

@ramilbakhshyiev
Copy link
Contributor

@ItsPitt That's great, thank you so much! Could you resolve conflicts and rebase one more time? I will be import this and send to team for review as soon as you do.

@iotamudelta
Copy link
Contributor Author

@ramilbakhshyiev rebased and merged - hopefully correctly. Thanks for working on this!

@facebook-github-bot
Copy link
Contributor

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

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

6 participants