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

Add Bamba Model #10909

Merged
merged 78 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
62181d5
initial pr without tp fix
fabianlim Dec 5, 2024
51bc78c
fix casting in rms norm gated
fabianlim Dec 5, 2024
81b93b4
TP fix
fabianlim Dec 5, 2024
0f93e4a
fix mamba scan invalid address
fabianlim Dec 8, 2024
742ae79
some fixes and remove unused kernels
fabianlim Dec 12, 2024
b2dc5ca
fmt + lint
fabianlim Dec 12, 2024
9ad9e20
more comments
fabianlim Dec 12, 2024
25bf381
initial fix for chunked prefill (incomplete)
fabianlim Dec 12, 2024
43ce07c
improve comments
fabianlim Dec 12, 2024
80f14b5
do not attach seq_idx to attn_metadata
fabianlim Dec 12, 2024
6b8ac49
activate initial states for chunked prefill
fabianlim Dec 12, 2024
d788db6
reuse softplus and remove triton2 remark
fabianlim Dec 13, 2024
400db27
add comment on weight loader and format
fabianlim Dec 13, 2024
bda8ea7
rename test_jamba to test_hybrid and got rid of test_bamba
fabianlim Dec 13, 2024
66078d6
Merge remote-tracking branch 'upstream/main' into bamba-pr
fabianlim Dec 16, 2024
a74de9f
update bamba to ishybrid and support pp
fabianlim Dec 16, 2024
b44caa7
lint
fabianlim Dec 16, 2024
8cf3644
add unit test for mamba ssd
fabianlim Dec 16, 2024
e375b40
fix lint
fabianlim Dec 16, 2024
dcbae7b
full chunked-prefill fix (sans unit tests)
fabianlim Dec 21, 2024
2597105
format and add cont batch unit tests (will need more cases)
fabianlim Dec 23, 2024
db5eea5
fix kernel tests and add more chunked prefill cases
fabianlim Dec 23, 2024
dfbcb16
bound adjustment
fabianlim Dec 23, 2024
7913009
bound adjustment
fabianlim Dec 26, 2024
9c5d045
lint errors
fabianlim Dec 26, 2024
6bc9dac
Add permalink correction from @tlrmchlsmth
fabianlim Jan 3, 2025
6d02e85
improved comment for segsum, add more sizes for test_mamba_chunk_scan…
fabianlim Jan 3, 2025
e5882f2
rename and comment functions, add more sizes for test_mamba_chunk_sca…
fabianlim Jan 3, 2025
6d6fa86
addressed comments on mamba_mixer2.py
fabianlim Jan 3, 2025
773dd80
replace with get_rope
fabianlim Jan 3, 2025
63f5340
rope scaling
fabianlim Jan 4, 2025
89e36d8
fixes
fabianlim Jan 6, 2025
7a4ae96
zero out ssm states
fabianlim Jan 7, 2025
a9e149c
fix tests (sans updating dev checkpoint)
fabianlim Jan 7, 2025
5c9f48d
not replacing dev model for now
fabianlim Jan 11, 2025
55647b1
update requirements
fabianlim Jan 13, 2025
2342bc0
remove extraneous comment
fabianlim Jan 14, 2025
011c141
update test
fabianlim Jan 14, 2025
503bc42
fix lint
fabianlim Jan 15, 2025
312cf1d
fix lint
fabianlim Jan 15, 2025
c1db743
fix requirements-test
fabianlim Jan 15, 2025
c956a30
Mamba2 changes from #10909
tlrmchlsmth Jan 16, 2025
17923ad
Get Mamba2 working!
tlrmchlsmth Jan 16, 2025
4183d45
Add integration test -- something is wrong!!
tlrmchlsmth Jan 17, 2025
5377644
format
tlrmchlsmth Jan 17, 2025
39f55d1
fixes
tlrmchlsmth Jan 17, 2025
dd31f19
update test registry, fixes
fabianlim Jan 16, 2025
e2e5aac
Fix for conv state shape and update placeholder_attn
tlrmchlsmth Jan 19, 2025
bc1b8af
back out placeholder_attn changes
tlrmchlsmth Jan 19, 2025
9db0dd5
make seq_idx to chunk indices more efficient
fabianlim Jan 20, 2025
cd89283
WIP debugging, restore local mamba and placeholder_attn changes
tlrmchlsmth Jan 20, 2025
9a838a3
Integration tests are now green
tlrmchlsmth Jan 20, 2025
be8318e
remove bamba-specific files
tlrmchlsmth Jan 20, 2025
f34d434
Merge branch 'main' into tms/mamba2
tlrmchlsmth Jan 27, 2025
a65e2cb
Handle grouping in Mixer2RMSNormGated
tlrmchlsmth Jan 30, 2025
0d4bb0f
debug cruft
tlrmchlsmth Jan 30, 2025
74f6088
Remove codestral integration test
tlrmchlsmth Jan 30, 2025
95583b8
Merge branch 'tms/mamba2' into bamba-pr
fabianlim Feb 1, 2025
b72389c
update mamba_cache
fabianlim Feb 1, 2025
10d75eb
remove changes to requirements
fabianlim Feb 1, 2025
5aea1e6
revert changes
fabianlim Feb 1, 2025
2ee8d07
Merge remote-tracking branch 'upstream/main' into bamba-pr
fabianlim Feb 1, 2025
043e006
fix lint
fabianlim Feb 1, 2025
7e4ce4f
fix lint
fabianlim Feb 1, 2025
8219480
more reverts
fabianlim Feb 1, 2025
2a154e1
remove unnecessary stuff
fabianlim Feb 3, 2025
b0536f7
add mixer2 gated norm TP test
fabianlim Feb 3, 2025
b2e7952
Merge remote-tracking branch 'upstream/main' into bamba-pr
fabianlim Feb 3, 2025
06c4e7f
add header
fabianlim Feb 3, 2025
851239a
fix lint
fabianlim Feb 3, 2025
6466c3c
Merge branch 'main' into bamba-pr
tlrmchlsmth Feb 3, 2025
64f6a4e
checkpoint renames
fabianlim Feb 4, 2025
266ce81
(debug) test_mamba_ssm_ssd.py
fabianlim Feb 4, 2025
965620d
[debug] make all run same shard_id
fabianlim Feb 4, 2025
4a846ab
[debug] disable test case
fabianlim Feb 4, 2025
da380b1
revert debugs and add @tlrmchlsmth fix!
fabianlim Feb 6, 2025
51d3762
Merge branch 'main' into bamba-pr
tlrmchlsmth Feb 6, 2025
eba332a
update mamba and jamba for MambaCache changes
tlrmchlsmth Feb 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

from ...utils import check_outputs_equal

MODELS = ["ai21labs/Jamba-tiny-dev"]
# This test is for the hybrid models
MODELS = ["ai21labs/Jamba-tiny-dev", "ibm-fms/Bamba-9.8b-1.8T-hf"]


@pytest.mark.parametrize("model", MODELS)
Expand Down Expand Up @@ -140,7 +141,7 @@ def test_mamba_prefill_chunking(hf_runner, vllm_runner, example_prompts,


@pytest.mark.parametrize("model", MODELS)
@pytest.mark.parametrize("dtype", ["bfloat16"])
@pytest.mark.parametrize("dtype", ["float"])
@pytest.mark.parametrize("max_tokens", [15])
def test_parallel_sampling(
vllm_runner,
Expand Down Expand Up @@ -243,17 +244,17 @@ def test_fail_upon_inc_requests_and_finished_requests_lt_available_blocks(
dtype: str,
example_prompts,
) -> None:
# This test is for verifying that the Jamba inner state management doesn't
# This test is for verifying that the hybrid inner state management doesn't
# collapse in case where the number of incoming requests and
# finished_requests_ids is larger than the maximum mamba block capacity.
# This could generally happen due to the fact that Jamba does support
# This could generally happen due to the fact that hybrid does support
# statelessness mechanism where it can cleanup new incoming requests in
# a single step.
try:
with vllm_runner(model, dtype=dtype, max_num_seqs=10) as vllm_model:
vllm_model.generate_greedy([example_prompts[0]] * 100, 10)
except ValueError:
pytest.fail("Jamba inner state wasn't cleaned up properly between"
pytest.fail("Hybrid inner state wasn't cleaned up properly between"
"steps finished requests registered unnecessarily ")


Expand All @@ -265,14 +266,14 @@ def test_state_cleanup(
dtype: str,
example_prompts,
) -> None:
# This test is for verifying that the Jamba state is cleaned up between
# This test is for verifying that the Hybrid state is cleaned up between
# steps, If its not cleaned, an error would be expected.
try:
with vllm_runner(model, dtype=dtype) as vllm_model:
for _ in range(10):
vllm_model.generate_greedy([example_prompts[0]] * 100, 1)
except ValueError:
pytest.fail("Jamba inner state wasn't cleaned up between states, "
pytest.fail("Hybrid inner state wasn't cleaned up between states, "
"could be related to finished_requests_ids")


Expand Down Expand Up @@ -318,7 +319,7 @@ def test_multistep_correctness(vllm_runner, model: str, dtype: str,
@pytest.mark.parametrize("model", MODELS)
@pytest.mark.parametrize("dtype", ["float"])
@pytest.mark.parametrize("max_tokens", [64])
def test_jamba_distributed_produces_identical_generation(
def test_hybrid_distributed_produces_identical_generation(
vllm_runner, model: str, dtype: str, max_tokens: int,
example_prompts) -> None:

Expand Down
Loading
Loading