Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add dev branch to CI#81

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
austinvhuang merged 11 commits intoAnswerDotAI:devfromjunjihashimoto:fix/dev-ci
Oct 8, 2025

Conversation

@junjihashimoto
Copy link
Collaborator

@junjihashimotojunjihashimoto commentedSep 5, 2025
edited
Loading

The dev branch has compilation errors due to an incorrect INCLUDE header.
This PR adds the dev branch to CI and fixes the error.

austinvhuang reacted with thumbs up emoji
@junjihashimotojunjihashimotoforce-pushed thefix/dev-ci branch 2 times, most recently froma809765 to9cfd436CompareSeptember 7, 2025 06:54
@junjihashimotojunjihashimotoforce-pushed thefix/dev-ci branch 6 times, most recently from6976369 to2bc52bfCompareSeptember 9, 2025 05:48
Comment on lines +845 to +848
Tensor tensor =createTensor(ctx, shape, ki8);
wgpuQueueWriteBuffer(ctx.queue, tensor.data.buffer,0, packed.data(),
tensor.data.size);
return tensor;
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

ki8 is packed into uint32_t while the shape is the same.
It caused out of bounds access and segmentation faults when copying data.

MichealReed reacted with thumbs up emoji
Comment on lines +1617 to +1618
// cbData->buffer needs to be freed, but calling it here will cause a segmentation fault.
// wgpuBufferRelease(cbData->buffer);
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

I don't know the appropriate time to release it, but if we run it here, a segmentation fault will occur.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, hard to manage, got stuck on this some too across platforms. Maybe we can return a pointer to the buffer and require the frontend consumer to release it?

Comment on lines 112 to 119
if(APPLE)
set(ABSEIL_COPTS_FILE"${DAWN_DIR}/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake")
if(EXISTS"${ABSEIL_COPTS_FILE}")
file(READ"${ABSEIL_COPTS_FILE}" COPTS_CONTENT)
string(REGEX REPLACE"-msse4\\.1""" COPTS_CONTENT"${COPTS_CONTENT}")
file(WRITE"${ABSEIL_COPTS_FILE}""${COPTS_CONTENT}")
endif()
endif()
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

There are many differences due to the line ending code being changed from DOS to Unix, but this is the only part that needs to be corrected. There is no msse4.1 flag on MacOS, so we need to remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! I'm not familiar / rarely use the cmake builds.@MichealReed if you have a chance maybe could see if this these changes make sense (could be after we merge to dev).

Copy link
Contributor

Choose a reason for hiding this comment

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

@junjihashimoto maybe we can just merge the changes fromhttps://github.com/Practicalxr/minigpu/blob/master/minigpu_ffi/src/cmake/dawn.cmake? This successfully builds Dawn for mobile platforms now too. I think the core of getting it to build on Mac/iOS was disabling glfw and tint test/cmd/examples.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

@MichealReed I tried using the dawn.cmake with gpu.cpp.

I get the following error:

gpu.cpp/external/dawn/src/dawn/native/metal/PhysicalDeviceMTL.mm:140:50: error: use of undeclared identifier 'kIOMainPortDefault'  140 |         AcquireIORef(IOServiceGetMatchingService(kIOMainPortDefault, matchingDict.Detach()));

This is due to differences in OS versions. Setting kIOMainPortDefault to 0 allows you to proceed.

STDLIB := -stdlib=libc++
endif
FLAGS=-std=c++17$(STDLIB) -I$(GPUCPP) -I$(GPUCPP)/third_party/headers -L$(GPUCPP)/third_party/lib run.cpp -ldl -lwebgpu_dawn
FLAGS=-std=c++17$(STDLIB) -I$(GPUCPP) -I$(GPUCPP)/third_party/headers -I$(GPUCPP)/third_party/headers/webgpu -L$(GPUCPP)/third_party/lib run.cpp -ldl -lwebgpu_dawn -Wl,-rpath,$(GPUCPP)/third_party/lib
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

This adds a search path to the program so that we don't need to set LD_LIBRARY_PATH.

@junjihashimotojunjihashimoto marked this pull request as ready for reviewSeptember 11, 2025 17:09
for (int i =0; i < N; ++i) {
inputArr[i] =static_cast<float>(i) /10.0;// dummy input data
}
std::cout << Shape{N} << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

minor nit, but generally try to avoid iostream (mostly use cstdio)

gpu.hpp Outdated
}
};

inline std::ostream&operator<<(std::ostream& os,const Shape& shape)
Copy link
Contributor

Choose a reason for hiding this comment

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

(same as above re avoiding iostream)

@austinvhuang
Copy link
Contributor

Thanks very much. Any objections to removing the iostream bits? Besides that, can go ahead and merge to dev.

Would be helpful if@MichealReed or others using the cmake builds could chime in on the cmake implementation as I'm not that familiar with the implementation / usage.

@junjihashimoto
Copy link
CollaboratorAuthor

@austinvhuang
Thank you for your review. I don't need iostreams, but some kind of stringification function would make printf debugging easier.
There's also std::format, but it might be too early to use it. (I just noticed it while researching.)
https://www.cppstories.com/2022/custom-stdformat-cpp20/
A simple 'templatestd::string to_string(const T& u)' would be sufficient.

@austinvhuangaustinvhuang merged commit22692e2 intoAnswerDotAI:devOct 8, 2025
2 of 3 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@austinvhuangaustinvhuangaustinvhuang left review comments

+1 more reviewer

@MichealReedMichealReedMichealReed left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@junjihashimoto@austinvhuang@MichealReed

[8]ページ先頭

©2009-2025 Movatter.jp