Skip to content

Commit

Permalink
Merge branch 'main' into find_custom_op_by_name
Browse files Browse the repository at this point in the history
  • Loading branch information
khalatepradnya committed Jul 19, 2024
2 parents 4c1e949 + b1d7214 commit db1691f
Show file tree
Hide file tree
Showing 141 changed files with 4,727 additions and 1,019 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/config/gitlab_commits.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nvidia-mgpu-repo: cuda-quantum/cuquantum-mgpu.git
nvidia-mgpu-commit: 59b8ed189989d6d2d944e41d8fbc5881b289c83c
nvidia-mgpu-commit: d46ce1f4848448b64bb1f1224b476a099831802c
5 changes: 2 additions & 3 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ jobs:
create_function_result=$(ngc-cli/ngc cloud-function function create \
--container-image nvcr.io/${{ env.NGC_QUANTUM_ORG }}/${{ env.NGC_QUANTUM_TEAM }}/cuda-quantum:nightly \
--container-environment-variable NUM_GPUS:1 \
--container-environment-variable NVQC_REST_PAYLOAD_VERSION:1 \
--container-environment-variable NVQC_REST_PAYLOAD_VERSION:1.1 \
--api-body-format CUSTOM \
--inference-port 3030 \
--health-uri / \
Expand Down Expand Up @@ -541,8 +541,7 @@ jobs:
# unsupport_args and compile_errors are compile error tests
# pauli_word: https://github.com/NVIDIA/cuda-quantum/issues/1957
# nested_vectors: related to vector of pauli_words (https://github.com/NVIDIA/cuda-quantum/issues/1957)
# vqe_h2: "Unknown gep/load configuration for synthesis", only on NVQC.
if [[ "$filename" != *"unsupport_args"* ]] && [[ "$filename" != *"compile_errors"* ]] && [[ "$filename" != *"vqe_h2"* ]] && [[ "$filename" != *"nested_vectors"* ]] && [[ "$filename" != *"pauli_word"* ]]; then
if [[ "$filename" != *"unsupport_args"* ]] && [[ "$filename" != *"compile_errors"* ]] && [[ "$filename" != *"nested_vectors"* ]] && [[ "$filename" != *"pauli_word"* ]]; then
echo "$filename"
nvqc_config=""
# Look for a --remote-mqpu-auto-launch to determine the number of QPUs
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/nvqc_regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ jobs:
# unsupport_args and compile_errors are compile error tests
# pauli_word: https://github.com/NVIDIA/cuda-quantum/issues/1957
# nested_vectors: related to vector of pauli_words (https://github.com/NVIDIA/cuda-quantum/issues/1957)
# vqe_h2: "Unknown gep/load configuration for synthesis", only on NVQC.
if [[ "$filename" != *"unsupport_args"* ]] && [[ "$filename" != *"state_overlap"* ]] && [[ "$filename" != *"compile_errors"* ]] && [[ "$filename" != *"vqe_h2"* ]] && [[ "$filename" != *"nested_vectors"* ]] && [[ "$filename" != *"pauli_word"* ]]; then
if [[ "$filename" != *"unsupport_args"* ]] && [[ "$filename" != *"state_overlap"* ]] && [[ "$filename" != *"compile_errors"* ]] && [[ "$filename" != *"nested_vectors"* ]] && [[ "$filename" != *"pauli_word"* ]]; then
echo "$filename"
nvqc_config=""
# Look for a --remote-mqpu-auto-launch to determine the number of QPUs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -933,9 +933,9 @@ jobs:
shell: bash
run: |
backends_to_test=`\
for file in $(ls $CUDA_QUANTUM_PATH/targets/*.config); \
for file in $(ls $CUDA_QUANTUM_PATH/targets/*.yml); \
do
if [ -n "$(cat $file | grep "GPU_REQUIREMENTS")" ]; then \
if [ -n "$(cat $file | grep "gpu-requirements")" ]; then \
basename $file | cut -d "." -f 1; \
elif [ -n "$(basename $file | grep mqpu)" ]; then \
echo remote-mqpu; \
Expand Down
4 changes: 2 additions & 2 deletions cmake/AddCUDAQ.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ function(add_cudaq_translation_library name)
endfunction()

function(add_target_config name)
install(FILES ${name}.config DESTINATION targets)
configure_file(${name}.config ${CMAKE_BINARY_DIR}/targets/${name}.config COPYONLY)
install(FILES ${name}.yml DESTINATION targets)
configure_file(${name}.yml ${CMAKE_BINARY_DIR}/targets/${name}.yml COPYONLY)
endfunction()

function(add_target_mapping_arch providerName name)
Expand Down
2 changes: 1 addition & 1 deletion cmake/WheelBuildHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function(add_target_libs_to_wheel nvqir_backend_lib_or_config)
if ("${FILE_EXTENSION}" STREQUAL ".so")
message(STATUS "Installing NVQIR backend lib '${nvqir_backend_lib_or_config}'")
install(FILES ${nvqir_backend_lib_or_config} DESTINATION lib)
elseif("${FILE_EXTENSION}" STREQUAL ".config")
elseif("${FILE_EXTENSION}" STREQUAL ".yml")
message(STATUS "Installing NVQIR backend config '${nvqir_backend_lib_or_config}'")
install(FILES ${nvqir_backend_lib_or_config} DESTINATION targets)
else()
Expand Down
22 changes: 18 additions & 4 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@
# SOURCE_LOCATION: location of the source file (relative to 'sphinx/examples/cpp' directory by default)
# Optional keyword args:
# TARGET <TARGET_NAME>: name of the target to use
# TARGET_OPTION <Option>: extra option for the target
# SOURCE_DIR <DIR>: the directory that SOURCE_LOCATION is relative to (if not the default)
# LAUNCH_COMMAND <COMMAND>: the command to launch the test (e.g., mpirun)
function(add_nvqpp_test TEST_NAME SOURCE_LOCATION)
cmake_parse_arguments(PARSED_ARGS "" "TARGET;LABELS;SOURCE_DIR;LAUNCH_COMMAND;APPLICATION_ARGS" "" ${ARGN})
cmake_parse_arguments(PARSED_ARGS "" "TARGET;LABELS;SOURCE_DIR;LAUNCH_COMMAND;APPLICATION_ARGS;TARGET_OPTION" "" ${ARGN})
set(NVQPP_COMPILE_ARGS "")
if(PARSED_ARGS_TARGET)
set(NVQPP_COMPILE_ARGS "${NVQPP_COMPILE_ARGS} --target ${PARSED_ARGS_TARGET}")
if (PARSED_ARGS_TARGET_OPTION)
set(NVQPP_COMPILE_ARGS "${NVQPP_COMPILE_ARGS} --${PARSED_ARGS_TARGET}-option ${PARSED_ARGS_TARGET_OPTION}")
endif()
endif()
if (NOT PARSED_ARGS_SOURCE_DIR)
set(PARSED_ARGS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/sphinx/examples/cpp")
Expand Down Expand Up @@ -68,9 +72,14 @@ if (CUSTATEVEC_ROOT AND CUDA_FOUND)
add_nvqpp_test(QuickStart_nvidia quick_start.cpp TARGET nvidia LABELS gpu_required SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp)

# mqpu snippets need custatevec backend and optionally MPI
add_nvqpp_test(SampleAsync using/cudaq/platform/sample_async.cpp TARGET nvidia-mqpu LABELS gpu_required SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp)
add_nvqpp_test(ObserveMQPU using/cudaq/platform/observe_mqpu.cpp TARGET nvidia-mqpu LABELS gpu_required SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp)
add_nvqpp_test(StateAsyncMQPU using/cudaq/platform/get_state_async.cpp TARGET nvidia-mqpu LABELS gpu_required SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp)
add_nvqpp_test(SampleAsync using/cudaq/platform/sample_async.cpp TARGET nvidia TARGET_OPTION mqpu LABELS gpu_required SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp)
add_nvqpp_test(ObserveMQPU using/cudaq/platform/observe_mqpu.cpp TARGET nvidia TARGET_OPTION mqpu LABELS gpu_required SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp)
add_nvqpp_test(StateAsyncMQPU using/cudaq/platform/get_state_async.cpp TARGET nvidia TARGET_OPTION mqpu LABELS gpu_required SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp)

# Legacy check for the `nvidia-mqpu` target
add_nvqpp_test(LegacySampleAsync using/cudaq/platform/sample_async.cpp TARGET nvidia-mqpu LABELS gpu_required SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp)
add_nvqpp_test(LegacyObserveMQPU using/cudaq/platform/observe_mqpu.cpp TARGET nvidia-mqpu LABELS gpu_required SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp)
add_nvqpp_test(LegacyStateAsyncMQPU using/cudaq/platform/get_state_async.cpp TARGET nvidia-mqpu LABELS gpu_required SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp)

# Add the MPI test if MPI was found and there are more than 2 GPUs
if (MPI_CXX_FOUND)
Expand All @@ -81,6 +90,11 @@ if (CUSTATEVEC_ROOT AND CUDA_FOUND)
# Only build this test if we have more than 1 GPU
if (${NGPUS} GREATER_EQUAL 2)
add_nvqpp_test(ObserveMQPU_MPI using/cudaq/platform/observe_mqpu_mpi.cpp
TARGET nvidia
TARGET_OPTION mqpu
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp
LAUNCH_COMMAND "${MPIEXEC} --allow-run-as-root -np 2")
add_nvqpp_test(LegacyObserveMQPU_MPI using/cudaq/platform/observe_mqpu_mpi.cpp
TARGET nvidia-mqpu
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/snippets/cpp
LAUNCH_COMMAND "${MPIEXEC} --allow-run-as-root -np 2")
Expand Down
3 changes: 3 additions & 0 deletions docs/sphinx/api/languages/cpp_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ Platform
.. doxygenclass:: cudaq::quantum_platform
:members:

.. doxygenstruct:: cudaq::RemoteCapabilities
:members:

.. doxygenclass:: cudaq::SerializedCodeExecutionContext

.. doxygentypedef:: cudaq::QuantumTask
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/examples/cpp/algorithms/bernstein_vazirani.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Compile and run with:
// ```
// nvq++ bernstein_vazirani.cpp -o bv.x --target nvidia-mgpu
// nvq++ bernstein_vazirani.cpp -o bv.x --target nvidia --target-option mgpu
// mpirun -np 4 ./bv.x
// ```

Expand Down
Loading

0 comments on commit db1691f

Please sign in to comment.