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

Remote-MQPU to support C++-17 standard #1111

Closed
1tnguyen opened this issue Jan 19, 2024 · 5 comments · Fixed by #1435
Closed

Remote-MQPU to support C++-17 standard #1111

1tnguyen opened this issue Jan 19, 2024 · 5 comments · Fixed by #1435
Assignees

Comments

@1tnguyen
Copy link
Collaborator

Currently, --target remote-mqpu does not work with C++-17 standard.
We need to add C++17 support for this target.

@1tnguyen 1tnguyen self-assigned this Jan 19, 2024
@bettinaheim bettinaheim added this to the release 0.7.0 milestone Jan 22, 2024
@schweitzpgi
Copy link
Collaborator

What is the error?

@bmhowe23
Copy link
Collaborator

I believe you can search our codebase for FIXME: https://github.com/NVIDIA/cuda-quantum/issues/1111. Here is one example:
https://github.com/NVIDIA/cuda-quantum/blob/main/test/Remote-Sim/args_parsing.cpp#L11 .

I wonder if it's possible that it's also just missing the %cpp_std from those tests?

@schweitzpgi
Copy link
Collaborator

schweitzpgi commented Jan 31, 2024

The linked one [Ed: all of them] has a REQUIRES: c++20 which empirically avoids the broken configuration.

Still would be good to know what the failure mode actually is.

@bettinaheim
Copy link
Collaborator

The linked one [Ed: all of them] has a REQUIRES: c++20 which empirically avoids the broken configuration.

Still would be good to know what the failure mode actually is.

I just checked. 3 tests pass when setting the appropriate --std=c++17 flag, the the failures for the others are the following:

These all run into the same issue, which looks related to serialization/deserialization (@1tnguyen I though we didn't have a new dependency there, do we?):

  • CUDAQ :: Remote-Sim/args_parsing.cpp
  • CUDAQ :: Remote-Sim/free_func.cpp
  • CUDAQ :: Remote-Sim/observe.cpp
  • CUDAQ :: Remote-Sim/sample.cpp
JIT session error: Symbols not found: [ _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEcvSt17basic_string_viewIcS2_EEv ]
Failure value returned from cantFail wrapped call
Failed to materialize symbols: { (main, { _ZGVN5cudaq5types1h4nameB5cxx11E, _ZN9__gnu_cxx13new_allocatorISt7complexIdEED2Ev, _ZNSt12_Destroy_auxILb1EE9__destroyIPSt7complexIdEEEvT_S5_, _ZN5cudaq5types1x4nameB5cxx11E, _ZNSt5tupleIJSt6vectorImSaImEES0_ISt7complexIdESaIS4_EEEED2Ev, _ZNSt13unordered_mapISt6vectorIbSaIbEESt7complexIdESt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_S4_EEED2Ev, _ZN5cudaq9ResourcesC2Ev, _ZN5cudaq7details6futureC2Ev, _ZN5cudaq5types1h4nameB5cxx11E, _ZSt8_DestroyIPSt7complexIdEEvT_S3_, _ZNSt14_Optional_baseIPN5cudaq7spin_opELb1ELb1EEC2Ev, _ZNSt3mapIN5cudaq5pauliENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS1_ESaISt4pairIKS1_S7_EEED2Ev, _ZNSt6vectorIN5cudaq9QuditInfoESaIS1_EE3endEv, _ZNSt12_Vector_baseISt7complexIdESaIS1_EED2Ev, _ZNSt8optionalIPN5cudaq7spin_opEEC2Ev, _ZNSt8__detail21_Hash_node_value_baseISt4pairIKSt6vectorIbSaIbEESt7complexIdEEE9_M_valptrEv, _ZNSt8optionalIdEC2ESt9nullopt_t, _ZNSt22_Optional_payload_baseIN5cudaq13sample_resultEED2Ev, _ZNSt12_Vector_baseISt7complexIdESaIS1_EE19_M_get_Tp_allocatorEv, _ZNSt17_Optional_payloadIN5cudaq13sample_resultELb1ELb0ELb0EED2Ev, _ZN9__gnu_cxx17__normal_iteratorIPN5cudaq9QuditInfoESt6vectorIS2_SaIS2_EEEppEv, _ZNSt10_Head_baseILm1ESt6vectorISt7complexIdESaIS2_EELb0EED2Ev, _ZN5cudaq16ExecutionContextC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm, _ZNSt22_Optional_payload_baseIN5cudaq13sample_resultEE10_M_destroyEv, _ZSt10_ConstructIN5cudaq9QuditInfoEJRS1_EEvPT_DpOT0_, _ZNSt6vectorISt7complexIdESaIS1_EED2Ev, _ZNSt10unique_ptrIN5cudaq16ExecutionContextESt14default_deleteIS1_EEC2IS3_vEEPS1_, _ZNSt5tupleIJSt6vectorImSaImEES0_ISt7complexIdESaIS4_EEEEC2ILb1ELb1EEEv, _ZNSt8__detail21_Hashtable_ebo_helperILi0ESt8equal_toIN5cudaq9Resources11InstructionEELb1EEC2Ev, _ZNSt17_Optional_payloadIN5cudaq13sample_resultELb0ELb0ELb0EED2Ev, _ZNSt8_Rb_treeIN5cudaq5pauliESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE8_S_rightEPSt18_Rb_tree_node_base, _ZNSt10unique_ptrIN5cudaq16ExecutionContextESt14default_deleteIS1_EED2Ev, _ZNSt13unordered_mapIN5cudaq9Resources11InstructionEmNS1_15InstructionHashESt8equal_toIS2_ESaISt4pairIKS2_mEEEC2Ev, _ZNSt22_Optional_payload_baseIN5cudaq13sample_resultEE8_M_resetEv,  ...

The async functions run into an error due to a lack of suitable copy constructor for a tuple version that it seems to be picking up from the system:

  • CUDAQ :: Remote-Sim/observe_async.cpp:
  • CUDAQ :: Remote-Sim/sample_async.cpp
/cuda-quantum/runtime/cudaq/algorithms/sample.h:168:23: note: in instantiation of function template specialization 'std::function<cudaq::sample_result ()>::function<(lambda at /cuda-quantum/runtime/cudaq/algorithms/sample.h:169:7), void>' requested here
  KernelExecutionTask task(
                      ^
/cuda-quantum/test/Remote-Sim/sample_async.cpp:31:38: note: in instantiation of function template specialization 'cudaq::sample_async<simpleX, unsigned long, void>' requested here
    countFutures.emplace_back(cudaq::sample_async(i, simpleX{}, i + 1));
                                     ^
/cuda-quantum/runtime/cudaq/algorithms/sample.h:170:8: note: copy constructor of '(lambda at /cuda-quantum/runtime/cudaq/algorithms/sample.h:169:7)' is implicitly deleted because field '' has a deleted copy constructor
       kernel = std::forward<KernelFunctor>(wrappedKernel)]() mutable {
       ^
/cuda-quantum/runtime/cudaq/algorithms/sample.h:389:8: note: copy constructor of '(lambda at /cuda-quantum/runtime/cudaq/algorithms/sample.h:388:7)' is implicitly deleted because field '' has a deleted copy constructor
...
/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/tuple:660:17: note: explicitly defaulted function was implicitly deleted here
      constexpr tuple(const tuple&) = default;
                ^
/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/tuple:556:19: note: copy constructor of 'tuple<unsigned long &&>' is implicitly deleted because base class '_Tuple_impl<0, unsigned long &&>' has a deleted copy constructor
    class tuple : public _Tuple_impl<0, _Elements...>

(same error if I add a gcc-11 toolchain installation, just now for the tuple implementation from there)

@bettinaheim
Copy link
Collaborator

Possibly related: #1281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants