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

[FIX] reorder initializer #18097

Merged
merged 1 commit into from
Oct 27, 2023
Merged

[FIX] reorder initializer #18097

merged 1 commit into from
Oct 27, 2023

Conversation

mindest
Copy link
Contributor

@mindest mindest commented Oct 25, 2023

Description

Fix building error when with collective ops: error is thrown because device_mesh_axis will be initialized after cond.

error detail (found when building in ROCm)
...
In file included from /ws/onnxruntime/build/Linux/Release/amdgpu/onnxruntime/contrib_ops/rocm/collective/sharding_spec.cc:4:
/ws/onnxruntime/build/Linux/Release/amdgpu/onnxruntime/contrib_ops/rocm/collective/sharding_spec.h: In constructor ‘onnxruntime::contrib::rocm::AxisPartitionSpec::AxisPartitionSpec(onnxruntime::contrib::rocm::AxisPartitionSpec::Condition, int)’:
/ws/onnxruntime/build/Linux/Release/amdgpu/onnxruntime/contrib_ops/rocm/collective/sharding_spec.h:104:7: error: ‘onnxruntime::contrib::rocm::AxisPartitionSpec::device_mesh_axis’ will be initialized after [-Werror=reorder]
  104 |   int device_mesh_axis;
      |       ^~~~~~~~~~~~~~~~
/ws/onnxruntime/build/Linux/Release/amdgpu/onnxruntime/contrib_ops/rocm/collective/sharding_spec.h:99:13: error:   ‘onnxruntime::contrib::rocm::AxisPartitionSpec::Condition onnxruntime::contrib::rocm::AxisPartitionSpec::cond’ [-Werror=reorder]
   99 |   Condition cond;
      |             ^~~~
/ws/onnxruntime/build/Linux/Release/amdgpu/onnxruntime/contrib_ops/rocm/collective/sharding_spec.h:120:3: error:   when initialized here [-Werror=reorder]
  120 |   AxisPartitionSpec(Condition cond_, int device_mesh_axis_) : device_mesh_axis(device_mesh_axis_), cond(cond_) {}
      |   ^~~~~~~~~~~~~~~~~
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-undefined-var-template’ [-Werror]
...

@mindest mindest requested a review from wschin October 25, 2023 09:32
@mindest
Copy link
Contributor Author

mindest commented Oct 27, 2023

Thanks @pengwa @thiagocrepaldi

@mindest mindest merged commit 0f3a067 into main Oct 27, 2023
@mindest mindest deleted the linmin/init_order branch October 27, 2023 03:29
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
### Description
Fix building error when with collective ops: error is thrown because
`device_mesh_axis` will be initialized after `cond`.
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 this pull request may close these issues.

3 participants