From 4b89576cbf3fa6466e4baa5a69ae0d59da56f249 Mon Sep 17 00:00:00 2001 From: the magician <82004885@qq.com> Date: Wed, 15 Jul 2026 01:32:21 +0800 Subject: [PATCH] reduce docker build context and match working baseline --- .dockerignore | 11 +++++++++++ computility-run.yaml | 1 + qwen3_6_scripts/xformers.py | 18 +++++++++--------- 3 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d2dfafc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +.git +.gitignore +.dockerignore +worklogs +**/__pycache__ +**/*.pyc +**/*.pyo +**/*.log +**/*.pid +nohup.out +qwen3_6_scripts/nohup.out diff --git a/computility-run.yaml b/computility-run.yaml index a10c207..16569f3 100644 --- a/computility-run.yaml +++ b/computility-run.yaml @@ -50,3 +50,4 @@ env: value: '1' - name: LOOP1_NATIVE value: '1' + diff --git a/qwen3_6_scripts/xformers.py b/qwen3_6_scripts/xformers.py index 265c446..06d9998 100644 --- a/qwen3_6_scripts/xformers.py +++ b/qwen3_6_scripts/xformers.py @@ -335,10 +335,10 @@ def _get_seq_len_block_table_args( on the type of attention operation. Decoder attn -> select entirely decoder self-attention-related fields - Encoder/decoder cross-attn -> select encoder sequence lengths & + Encoder/decoder cross-attn -> select encoder sequence lengths & cross-attn block-tables fields Encoder attn -> select encoder sequence lengths fields & no block tables - + Arguments: * attn_metadata: Attention metadata structure associated with attention op @@ -384,11 +384,11 @@ class XFormersMetadataBuilder(CommonMetadataBuilder[XFormersMetadata]): class XFormersImpl(AttentionImpl[XFormersMetadata]): """ If the input tensors contain prompt tokens, the layout is as follows: - |<--------------- num_prefill_tokens ----------------->| + |<--------------- num_prefill_tokens ----------------->| |<--prefill_0-->|<--prefill_1-->|...|<--prefill_N-1--->| - Otherwise, the layout is as follows: - |<----------------- num_decode_tokens ------------------>| + Otherwise, the layout is as follows: + |<----------------- num_decode_tokens ------------------>| |<--decode_0-->|..........|<--decode_M-1-->|<--padding-->| Generation tokens can contain padding when cuda-graph is used. @@ -446,7 +446,7 @@ class XFormersImpl(AttentionImpl[XFormersMetadata]): self.head_mapping = torch.repeat_interleave( torch.arange(self.num_kv_heads, dtype=torch.int32), self.num_queries_per_kv) - + def forward( self, query: torch.Tensor, @@ -474,10 +474,10 @@ class XFormersImpl(AttentionImpl[XFormersMetadata]): (1) key and value tensors were cached during prefill, and (2) cross-attention key and value tensors do not grow during decode - + A note on how the attn_type (attention type enum) argument impacts attention forward() behavior: - + * DECODER: normal decoder-only behavior; use decoder self-attention block table * ENCODER: no KV caching; pass encoder sequence @@ -490,7 +490,7 @@ class XFormersImpl(AttentionImpl[XFormersMetadata]): will match encoder sequence lengths, pass encoder sequence attributes to kernel (encoder_seq_lens/encoder_seq_lens_tensor/ max_encoder_seq_len) - + Args: query: shape = [num_tokens, num_heads * head_size] key: shape = [num_tokens, num_kv_heads * head_size]