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

MacOS Support #174

Merged
merged 34 commits into from
Sep 27, 2024
Merged

MacOS Support #174

merged 34 commits into from
Sep 27, 2024

Conversation

KowerKoint
Copy link
Contributor

x86_64版のみですが、MacOSをサポートしました。
ついでにworkflow fileなどをいろいろ整理しました。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

formatだけ別のworkflowにすることで、ビルドの時間を待つことなくすぐにformat忘れがわかるようにした

Copy link
Contributor Author

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++' }}
Copy link
Contributor Author

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

Copy link
Contributor Author

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
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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);
Copy link
Contributor Author

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なのか…)くてエラーが起きたので修正しました

@KowerKoint
Copy link
Contributor Author

KowerKoint commented Sep 24, 2024

intel Macを持っていないので生成されたwheelの検証が現状できていませんが、CIでは動いているのでとりあえずマージしたいと思っています。
Arm64用のPRを別でやってそれは自分で検証できます。

@KowerKoint
Copy link
Contributor Author

Intel Mac (python 3.10) での動作確認をやっていただきました

Copy link
Contributor

@gandalfr-KY gandalfr-KY left a comment

Choose a reason for hiding this comment

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

OKです!

@KowerKoint KowerKoint merged commit 23facd6 into main Sep 27, 2024
22 checks passed
@KowerKoint KowerKoint mentioned this pull request Oct 16, 2024
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.

2 participants