Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions fastdeploy/model_executor/layers/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ def process_loaded_weights(self, layer, weights) -> None:
layer.weight.set_value(weights)

def apply(self, layer: nn.Layer, x: paddle.Tensor) -> paddle.Tensor:
linear_out = paddle.matmul(x, layer.weight)
if layer.with_bias:
linear_out = paddle.add(linear_out, layer.bias)
return linear_out
out = paddle.nn.functional.linear(x, layer.weight, layer.bias if layer.with_bias else None)
return out


class LinearBase(nn.Layer):
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/4cards_cases/test_GLM_45_AIR_mtp_tp4.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
is_port_open,
)

os.environ["FLAGS_use_legacy_linear"] = "1"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

建议单测不增加环境变量



@pytest.fixture(scope="session", autouse=True)
def setup_and_run_server():
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/4cards_cases/test_GLM_45_AIR_tp4.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
is_port_open,
)

os.environ["FLAGS_use_legacy_linear"] = "1"


@pytest.fixture(scope="session", autouse=True)
def setup_and_run_server():
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/test_EB_Lite_serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
is_port_open,
)

os.environ["FLAGS_use_legacy_linear"] = "1"


@pytest.fixture(scope="session", autouse=True)
def setup_and_run_server():
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/test_Qwen3VLMoe_serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
is_port_open,
)

os.environ["FLAGS_use_legacy_linear"] = "1"


@pytest.fixture(scope="session", autouse=True)
def setup_and_run_server():
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/test_ernie_03b_pd_router_v1_rdma_global_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
is_port_open,
)

os.environ["FLAGS_use_legacy_linear"] = "1"
# Read ports from environment variables; use default values if not set
FD_CONNECTOR_PORT = int(os.getenv("FD_CONNECTOR_PORT", 8433))
FD_ROUTER_PORT = int(os.getenv("FD_ROUTER_PORT", 8533))
Expand Down
Loading