forked from ggerganov/llama.cpp
-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: fix mulmat #2
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chraac
force-pushed
the
dev-multi-op-in-one-graph
branch
from
September 10, 2024 15:28
c34eecb
to
d55b067
Compare
next will set the prameter of transpose
chraac
force-pushed
the
dev-multi-op-in-one-graph
branch
from
September 18, 2024 05:31
14283fa
to
74d5016
Compare
chraac
force-pushed
the
dev-multi-op-in-one-graph
branch
from
September 19, 2024 14:03
7933c79
to
ed181a1
Compare
4 tasks
chraac
pushed a commit
that referenced
this pull request
Oct 3, 2024
* vulkan : do not use tensor->extra This patch allows using the Vulkan backend with the RPC backend as tensor->extra is no longer used. Ref: ggerganov#8536 * Adapt GGML_VULKAN_CHECK_RESULTS to extra removal (#2) --------- Co-authored-by: 0cc4m <[email protected]>
chraac
force-pushed
the
dev-multi-op-in-one-graph
branch
from
October 3, 2024 16:27
8e55942
to
a6deb22
Compare
chraac
commented
Oct 6, 2024
ggml/src/ggml-qnn/op-config.cpp
Outdated
* src1 -> | transpose0 | -> intermediate0 -> | mat_mul0 | | ||
*/ | ||
|
||
const auto tensor_rank = get_rank(tensor_inputs, tensor_outputs); |
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.
Here we add nodes to the mat_mul
graph, after this function ,the graph will be like:
graph TD;
i1>input_tensor_a] --src0--> mat_mul0;
i2>input_tensor_b] --src1--> transpose0;
transpose0 --intermediate0--> mat_mul0;
mat_mul0 --intermediate1--> transpose1;
transpose1 --dst0--> o1>output_tensor_c];
chraac
force-pushed
the
dev-multi-op-in-one-graph
branch
from
October 28, 2024 03:59
14f2205
to
327b3db
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In latest
dev-refactoring
, thetest-backend-ops
runs well onADD
operator, but failed onMUL_MAT
.After investigation, we found that the input tensor should be transposed (see: 63dc587).
Here's how we fix it:
INTERMEDIATE
andPARAMETER
. These types are graph-private and invisible to other graphs.INTERMEDIATE
tensor is used for connecting multiple operations within a single graph.PARAMETER
tensor is used for setting the parameters of certain operators, such astranspose
.ggml_qnn_matmul_op_config
class, for creating necessary nodes to matmul graphggml_qnn_matmul_op_config::create_tensors
, we will add several nodes, and finally make a graph like this:Log
test-backend-ops_MUL_MAT.log
Changes
ggml_qnn_op_config
, to manage the rensors, and support multi-optranspose
op beforemulmat
Self-check