[Perf][GLM-Image] Skip redundant hidden state D2H (#5346)
Signed-off-by: herotai214 <herotai214@gmail.com>
This commit is contained in:
1 parent
f4640d9a2e
commit
c96f0bc773
2 files changed
+9
No files matched your search
@@ -91,6 +91,10 @@ GlmImageRotaryEmbedding = _ar_mod.GlmImageRotaryEmbedding
|
|||||||
pytestmark = [pytest.mark.core_model, pytest.mark.cpu]
|
pytestmark = [pytest.mark.core_model, pytest.mark.cpu]
|
||||||
|
|
||||||
|
|
||||||
|
def test_glm_image_ar_omits_hidden_pooler_payload():
|
||||||
|
assert GlmImageForConditionalGeneration.omni_pooler_payload_include_hidden is False
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Helper: Minimal config for testing
|
# Helper: Minimal config for testing
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|||||||
@@ -2414,6 +2414,11 @@ class GlmImageForConditionalGeneration(nn.Module, SupportsMultiModal, SupportsPP
|
|||||||
# linear increments during decode.
|
# linear increments during decode.
|
||||||
precomputed_mrope_decode = True
|
precomputed_mrope_decode = True
|
||||||
|
|
||||||
|
# The downstream GLM-Image diffusion stage consumes generated token ids and
|
||||||
|
# optional VQ-VAE image ids, not AR hidden states. Avoid copying one hidden
|
||||||
|
# vector to host at every decode step.
|
||||||
|
omni_pooler_payload_include_hidden = False
|
||||||
|
|
||||||
packed_modules_mapping = {
|
packed_modules_mapping = {
|
||||||
"qkv_proj": [
|
"qkv_proj": [
|
||||||
"q_proj",
|
"q_proj",
|
||||||
|
|||||||
Reference in new issue
Block a user