-
Notifications
You must be signed in to change notification settings - Fork 0
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
MacOS Support #174
MacOS Support #174
Conversation
.github/workflows/format.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatだけ別のworkflowにすることで、ビルドの時間を待つことなくすぐにformat忘れがわかるようにした
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CPU版とGPU版を1種類のjobにしてmatrixで分けた
runs-on: ${{ matrix.runs-on }} | ||
env: | ||
CMAKE_C_COMPILER: ${{ matrix.os == 'macos' && '/usr/local/opt/ccache/libexec/gcc-14' || '/usr/lib/ccache/gcc' }} | ||
CMAKE_CXX_COMPILER: ${{ matrix.os == 'macos' && '/usr/local/opt/ccache/libexec/g++-14' || '/usr/lib/ccache/g++' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Macではg++
の中身はclang++になっているので…
SCALUQ_CUDA_ARCH: "PASCAL61" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
公式runnerに入っているもののパッケージを見て、GCCやCMakeのインストールは不要なことがわかったので消しました
key: "${{ github.job }}-${{ matrix.os }}-${{ matrix.device }}" | ||
verbose: 2 | ||
|
||
- name: Install CUDA toolkit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このstepが圧倒的に重いのでなんとかしたい………
CUDA版のCI用のイメージをghcr.ioに作っておいておくとか
for (size_t i = 0; i < view_d.extent(0); ++i) { | ||
for (size_t j = 0; j < view_d.extent(1); ++j) { | ||
for (std::size_t i = 0; i < view_d.extent(0); ++i) { | ||
for (std::size_t j = 0; j < view_d.extent(1); ++j) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ついでに見つけたので
@@ -217,7 +217,7 @@ TEST(StateVectorTest, SamplingSuperpositionState) { | |||
state.add_state_vector_with_coef(1 << i, tmp_state); | |||
} | |||
state.normalize(); | |||
std::vector<size_t> res = state.sampling(nshot); | |||
std::vector<std::uint64_t> res = state.sampling(nshot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macosではsize_tとstd::uint64_tが等しくないらし(32bitなのかsignedなのか…)くてエラーが起きたので修正しました
intel Macを持っていないので生成されたwheelの検証が現状できていませんが、CIでは動いているのでとりあえずマージしたいと思っています。 |
f6c1fc8
to
fc09b84
Compare
Intel Mac (python 3.10) での動作確認をやっていただきました |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OKです!
x86_64版のみですが、MacOSをサポートしました。
ついでにworkflow fileなどをいろいろ整理しました。