Skip to content

[Question] Do we need to set attention implementation to eager in config and in rotary setup component testing method? #1440

Description

@TensorCruncher

Question

Qwen3 adds self.cfg.attn_implementation = "eager" to the config.

It further adds the following code to the rotary setup component testing method:

if hasattr(hf_model, "config") and hasattr(hf_model.config, "_attn_implementation"):
    hf_model.config._attn_implementation = "eager"

if hasattr(hf_model, "model") and hasattr(hf_model.model, "layers"):
    for layer in hf_model.model.layers:
        if hasattr(layer, "self_attn") and hasattr(layer.self_attn, "config"):
            layer.self_attn.config._attn_implementation = "eager"

Is this something we should replicate elsewhere? Isn't eager the default attention implementation? So the code block exists just to ensure the bridge component and HF instance both execute eager attention?

Metadata

Metadata

Assignees

No one assigned

    Labels

    TransformerBridgeBug specific to the new TransformerBridge systemcomplexity-highVery complicated changes for people to address who are quite familiar with the codequestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions