Skip to content

Commit 4f73d60

Browse files
matthiaskrammGoogle-ML-Automation
authored andcommitted
Fix pytype late-directive warnings.
PiperOrigin-RevId: 949750872
1 parent 52e498f commit 4f73d60

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/maxtext/inference/maxengine/maxengine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,8 +1099,8 @@ def _prefill_multisampling_jit(
10991099
)
11001100
first_generated_tokens.append(first_generated_token)
11011101
if self.config.return_log_prob:
1102-
# pytype: disable=attribute-error
1103-
token_logps.append(inference_utils.log_prob_of_chosen_token(selected_logits, first_generated_token))
1102+
p = inference_utils.log_prob_of_chosen_token(selected_logits, first_generated_token)
1103+
token_logps.append(p) # pytype: disable=attribute-error
11041104
first_generated_tokens = jnp.concatenate(first_generated_tokens, axis=0)
11051105
if self.config.return_log_prob:
11061106
token_logps = jnp.concatenate(token_logps, axis=0)

src/maxtext/models/qwen3.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -658,14 +658,12 @@ def __call__(
658658
# vLLM PAGED STATE PATH: use tpu_inference fused conv + ragged delta-rule.
659659
# =========================================================================
660660
try:
661-
# pylint: disable=import-outside-toplevel
662-
# pytype: disable=import-error
663-
from tpu_inference.layers.common.gdn_attention import GdnAttentionConfig, run_jax_gdn_attention # pylint: disable=import-outside-toplevel
664-
from tpu_inference.layers.common.ragged_gated_delta_rule_wrapper import RaggedGatedDeltaRuleImpl # pylint: disable=import-outside-toplevel
665-
from tpu_inference.layers.common.sharding import ShardingAxisName # pylint: disable=import-outside-toplevel
666-
from tpu_inference.layers.common.utils import reorder_concatenated_tensor_for_sharding # pylint: disable=import-outside-toplevel
667-
from tpu_inference.utils import get_mesh_shape_product # pylint: disable=import-outside-toplevel
668-
from jax.sharding import PartitionSpec as P_spec # pylint: disable=import-outside-toplevel
661+
from tpu_inference.layers.common.gdn_attention import GdnAttentionConfig, run_jax_gdn_attention # pylint: disable=import-outside-toplevel # pytype: disable=import-error
662+
from tpu_inference.layers.common.ragged_gated_delta_rule_wrapper import RaggedGatedDeltaRuleImpl # pylint: disable=import-outside-toplevel # pytype: disable=import-error
663+
from tpu_inference.layers.common.sharding import ShardingAxisName # pylint: disable=import-outside-toplevel # pytype: disable=import-error
664+
from tpu_inference.layers.common.utils import reorder_concatenated_tensor_for_sharding # pylint: disable=import-outside-toplevel # pytype: disable=import-error
665+
from tpu_inference.utils import get_mesh_shape_product # pylint: disable=import-outside-toplevel # pytype: disable=import-error
666+
from jax.sharding import PartitionSpec as P_spec # pylint: disable=import-outside-toplevel # pytype: disable=import-error
669667
except ImportError as e:
670668
raise ImportError(
671669
"GDN attention kernel require the vllm-tpu package. Please install it with `pip install vllm-tpu`."

0 commit comments

Comments
 (0)