-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[inference] chatglm2 infer demo #4724
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 all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3e6175c
add chatglm2
CjhHa1 e992ff7
add
CjhHa1 79a0fa6
gather needed kernels
CjhHa1 2bca31f
fix some bugs
CjhHa1 b33da6a
finish context forward
CjhHa1 6e71d69
finish context stage
CjhHa1 95bd76c
fix
CjhHa1 ac6cf9f
add
CjhHa1 dae60a8
pause
CjhHa1 0c45002
add
CjhHa1 20b2df0
fix bugs
CjhHa1 58e0a6b
finish chatglm
CjhHa1 185ff15
fix bug
CjhHa1 321127b
change some logic
CjhHa1 065c834
fix bugs
CjhHa1 212e01b
change some logics
CjhHa1 0ddcfb1
add
CjhHa1 1c36ad9
add
CjhHa1 5da13fa
add
CjhHa1 7a1f7ae
Merge remote-tracking branch 'origin/main' into new_chatglm2
CjhHa1 9cf099c
fix
CjhHa1 0dc780d
fix tests
CjhHa1 6c477a4
fix
CjhHa1 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| import _utils | ||
|
|
||
| from .bloom import BloomInferenceForwards | ||
| from .chatglm2 import ChatGLM2InferenceForwards | ||
| from .llama import LlamaInferenceForwards | ||
|
|
||
| __all__ = ["BloomInferenceForwards", "LlamaInferenceForwards"] | ||
| __all__ = ["BloomInferenceForwards", "LlamaInferenceForwards", "ChatGLM2InferenceForwards"] |
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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| """ | ||
| Utils for model inference | ||
| """ | ||
| from colossalai.kernel.triton.copy_kv_cache_dest import copy_kv_cache_to_dest | ||
|
|
||
|
|
||
| def copy_kv_to_mem_cache(layer_id, key_buffer, value_buffer, context_mem_index, mem_manager): | ||
| copy_kv_cache_to_dest(key_buffer, context_mem_index, mem_manager.key_buffer[layer_id]) | ||
| copy_kv_cache_to_dest(value_buffer, context_mem_index, mem_manager.value_buffer[layer_id]) | ||
| return |
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.
Uh oh!
There was an error while loading. Please reload this page.