Skip to content

[Causal-LM Test]: Adding causal lm test cases for diff configs - #1180

Open
abukhoy wants to merge 15 commits into
quic:mainfrom
abukhoy:causal-test-infra
Open

[Causal-LM Test]: Adding causal lm test cases for diff configs#1180
abukhoy wants to merge 15 commits into
quic:mainfrom
abukhoy:causal-test-infra

Conversation

@abukhoy

@abukhoy abukhoy commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This is created for adding all the different test case for each text model with tiny models.

Test cases are following:

  1. Fp16 end to end run subfunction True by default. (end to end run+ output verification)
  2. Fp16 + Subfunction + CB (end to end run+ output verification)
  3. Fp16 + Subfunction + speculation + CB (end to end run+ output verification)
  4. Fp16 + Subfunction + CB with prefix caching (end to end run+ output verification)
  5. Fp16 + Subfunction + CB + CCL (end to end run+ output verification)
  6. FP32 export + FP16 compilation + Subfunction + CB + CCL (end to end run+ output verification)
  7. BF16 export and BF16 compilation + Subfunction + CB + CCL (only till compilation)
  8. Fp16 + Subfunction + CB + Blocking enabled
  9. FP16 + Disagg model + Subfunction + CB + CCL for Moe models (end to end run+ output verification) (ETA)

Each test case is separated with non-qaic part (export/compile) and qaic part (generate) so that later we can parallelize the export/compile i.e., non-qaic methods.

@abukhoy abukhoy mentioned this pull request Jul 14, 2026
@quic-rishinr
quic-rishinr requested review from quic-hemagnih, quic-rishinr and vbaddi and removed request for vbaddi July 15, 2026 05:13

test_models_blocking_dict = {"openai/gpt-oss-20b": "tiny-random/gpt-oss-bf16"}
test_models_chunking_dict = {"Qwen/Qwen3-30B-A3B-Instruct-2507": "hf-internal-testing/tiny-random-Qwen3MoeForCausalLM"}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add gemma4-26B model also

@pytest.mark.llm # FIXME split into llm and vllm later
@pytest.mark.parametrize("model_id", model_id_blocking)
@pytest.mark.parametrize("prompt", prompts)
def test_disagg_mode_prefill(model_id, prompt):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is this test for? I think we can check the functionality in test_disagg_mode_prefill_only_and_decode_only.

Anything specific we want to check with this test?

@pytest.mark.parametrize("prompt", [prompt1])
def test_disagg_mode_prefill_only_and_decode_only(model_id, prompt):
PREFILL_SEQ_LEN = 256
CTX_LEN = 256

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why prefill_seq_len and ctx_len same?

@pytest.mark.llm # FIXME split into llm and vllm later
@pytest.mark.parametrize("model_id", model_id_blocking)
@pytest.mark.parametrize("prompt", [prompt1])
def test_disagg_mode_prefix_caching(model_id, prompt):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lets add a note on top of each test case something like
Test case Name:
Intent of this test:
Feature impact if it fails:

This will make our life very easy in quick review down the line when number of test cases will increase

kv_out_batch0[f"past_value.{i}_RetainedState"][0] - kv_out_batch1[f"past_value.{i}_RetainedState"][1]
).max()
< QAIC_ATOL
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is decode only tests? That is PL =1. Do we need those tests or not?

Comment thread tests/transformers/models/causal_lm_models/test_models.py Outdated
Comment thread tests/transformers/models/causal_lm_models/test_models.py Outdated
Comment thread tests/transformers/models/causal_lm_models/test_models.py Outdated
Comment thread tests/conftest.py Outdated

@quic-rishinr quic-rishinr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please rebase the PR

abukhoy and others added 14 commits July 23, 2026 15:12
Signed-off-by: Abukhoyer SHaik <abukhoye@qti.qualcomm.com>
…tilities

- Extract common logic into gpt_oss_utils:
  - input preparation (_prepare_inputs)
  - dummy model creation (_make_dummy_model)
  - standardized compile kwargs (_default_compile_kwargs)
  - HF prefill execution (_run_hf_prefill)
  - QEff prefill execution (_run_qeff_prefill)
  - QPC execution (_run_qpc_prefill)
  - sliding-window KV rotation (_rotate_sliding_kv)
  - prefix caching inference (_prefix_caching_inference)

- Refactor tests to use shared helpers instead of inline logic
- Remove duplicated tokenization, KV cache, and session handling code
- Unify naming conventions and constants (TORCH_ATOL, QAIC_ATOL)

Signed-off-by: Vishali Senthilkumar <vishsent@qti.qualcomm.com>
Signed-off-by: Abukhoyer SHaik <abukhoye@qti.qualcomm.com>
Signed-off-by: Abukhoyer SHaik <abukhoye@qti.qualcomm.com>
Signed-off-by: Abukhoyer SHaik <abukhoye@qti.qualcomm.com>
Signed-off-by: Abukhoyer SHaik <abukhoye@qti.qualcomm.com>
Signed-off-by: Abukhoyer Shaik <abukhoye@qti.qualcomm.com>
Signed-off-by: Abukhoyer Shaik <abukhoye@qti.qualcomm.com>
Signed-off-by: Abukhoyer Shaik <abukhoye@qti.qualcomm.com>
Signed-off-by: Abukhoyer SHaik <abukhoye@qti.qualcomm.com>
Signed-off-by: Abukhoyer Shaik <abukhoye@qti.qualcomm.com>
Signed-off-by: Abukhoyer Shaik <abukhoye@qti.qualcomm.com>
Signed-off-by: Abukhoyer Shaik <abukhoye@qti.qualcomm.com>
… list and params

Signed-off-by: Abukhoyer Shaik <abukhoye@qti.qualcomm.com>
@abukhoy
abukhoy force-pushed the causal-test-infra branch from 608f6c8 to 80079d7 Compare July 23, 2026 09:57
Signed-off-by: Abukhoyer Shaik <abukhoye@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants