-
Notifications
You must be signed in to change notification settings - Fork 737
[Feat] ernie4_5_vl_moe support CudaGraph
#3226
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
Merged
Merged
Changes from 33 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
a135ab5
delete dynamic control flow for decode
aquagull 4add5d6
coda-style
aquagull 755ab26
Merge branch 'PaddlePaddle:develop' into cuda_graph_vl
aquagull 5ac10d9
fix scatter/gather typos and use input stream instead default stream
aquagull 533856c
support 0-Size Tensor
aquagull 4d64786
update runner and model
aquagull 7529cfc
using static mem address as input
aquagull 2e2a40d
fix mem leak
aquagull 07675c5
refine code
aquagull 8805721
update mm_buffer
aquagull 8d75410
Merge branch 'develop' into cuda_graph_vl
aquagull 75770a6
fix typo
e9ccc26
fix buffersize
5f14f13
Merge branch 'develop' into cuda_graph_vl
aquagull 571e9d7
Merge branch 'cuda_graph_vl' of https://github.com/aquagull/FastDeplo…
3c98efc
Merge branch 'develop' into cuda_graph_vl
aquagull 5fdd288
Merge remote-tracking branch 'paddle/develop' into cuda_graph_vl
aquagull 5555161
fix unk token
aquagull 8580d1d
Merge branch 'develop' into cuda_graph_vl
aquagull 44f3718
refine code
e3a5389
refine code
f2b0f1f
refine
90177cf
support other arch
aquagull 0f26ee4
fix toekn_type_ids buffer padding
03be126
open cudagraph in vlci
72e0fa9
fix
e9fd71e
Merge remote-tracking branch 'paddle/develop' into cuda_graph_vl
d067cd9
update
2994949
update
0b3aa07
update
f6d9c0c
Merge branch 'develop' into cuda_graph_vl
aquagull e63ad17
fix cmd
aquagull fe077b6
Merge branch 'develop' into cuda_graph_vl
aquagull b0b8cf3
update
aquagull 9050777
Merge branch 'develop' into cuda_graph_vl
aquagull db67cd2
Merge branch 'develop' into cuda_graph_vl
yuanlehome File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,3 +99,35 @@ def clear_grpah_opt_backend(self, fd_config): | |
| fd_config.graph_opt_config.graph_opt_level < 1 | ||
| ), "Currently unable to update weights in static graph mode." | ||
| self.graph_opt_backend.clear_cudagraph_piecewise_backend() | ||
|
|
||
|
|
||
| def mm_buffer(buffer_meta): | ||
aquagull marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| def decorator(cls): | ||
| original_init = cls.__init__ | ||
|
|
||
| def __init__(self, fd_config: FDConfig, **kwargs): | ||
| original_init(self, fd_config=fd_config, **kwargs) | ||
|
|
||
| def _resolve_path(root, path: str): | ||
| cur = root | ||
| for p in path.split("."): | ||
| cur = getattr(cur, p) | ||
| return cur | ||
|
|
||
| if not hasattr(self, "_mm_buffers"): | ||
| self._mm_buffers = {} | ||
| for name, meta in buffer_meta.items(): | ||
| shape = [_resolve_path(fd_config, s) if isinstance(s, str) else s for s in meta["shape"]] | ||
| dtype = meta["dtype"] | ||
| if "." in meta["dtype"]: | ||
| dtype = _resolve_path(fd_config, meta["dtype"]) | ||
| self._mm_buffers[name] = paddle.full( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. _mm_buffers这个变量名也改一下
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| shape=shape, | ||
| dtype=dtype, | ||
| fill_value=meta.get("value", 0), | ||
| ) | ||
|
|
||
| cls.__init__ = __init__ | ||
| return cls | ||
|
|
||
| return decorator | ||
aquagull marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
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.
c++代码最好也格式化一下