Repository navigation
[WIP] feat(npu): support MXFP8 datatype for A2E operator - #444
wangyibo1005 wants to merge 1 commit into
Conversation
5931383 to
03d93e2
Compare
Add support for MXFP8 input to the A2E operator on A5. Signed-off-by: wangyibo1005 <2633333316@qq.com> Co-Authored-By: Claude Code <noreply@anthropic.com>
03d93e2 to
b5c6410
Compare
The attention side quantizes the FFN activation before the transport, so the payload halves. The FFN side receives FP8 plus an E8M0 block scale and restores the model dtype, because the router and the shared experts can only consume a model-dtype activation. The connector rejects mode 4 when the operator or the patched prepare stage is unavailable, rather than failing later inside the kernel. Depends on the A2E MXFP8 operator support in vllm-project#444.
Record the quant mode, the measured gain, the operator requirement, and the concurrency precondition that decides whether the gain shows up at all. The transport section builds on the text in vllm-project#444; rebase it after that lands.
The attention side quantizes the FFN activation before the transport, so the payload halves. The FFN side receives FP8 plus an E8M0 block scale and restores the model dtype, because the router and the shared experts can only consume a model-dtype activation. The connector rejects mode 4 when the operator or the patched prepare stage is unavailable, rather than failing later inside the kernel. Depends on the A2E MXFP8 operator support in vllm-project#444. Signed-off-by: 宋元盟 <songyuanmeng1@huawei.com>
Record the quant mode, the measured gain, the operator requirement, and the concurrency precondition that decides whether the gain shows up at all. The transport section builds on the text in vllm-project#444; rebase it after that lands. Signed-off-by: 宋元盟 <songyuanmeng1@huawei.com>
The attention side quantizes the FFN activation before the transport, so the payload halves. The FFN side receives FP8 plus an E8M0 block scale and restores the model dtype, because the router and the shared experts can only consume a model-dtype activation. The connector rejects mode 4 when the operator or the patched prepare stage is unavailable, rather than failing later inside the kernel. Depends on the A2E MXFP8 operator support in vllm-project#444. Signed-off-by: 宋元盟 <songyuanmeng1@huawei.com>
Record the quant mode, the measured gain, the operator requirement, and the concurrency precondition that decides whether the gain shows up at all. The transport section builds on the text in vllm-project#444; rebase it after that lands. Signed-off-by: 宋元盟 <songyuanmeng1@huawei.com>
connector_extra_config.quant_mode=4 quantizes the Attention activation to E4M3 inside the opaque A2E call, ships it with its E8M0 MX scale, and hands the pair to the experts on the FFN side without dequantizing. Mode 0 keeps the twelve-argument BF16 call, so an operator build that predates the MXFP8 arguments still runs. Construction refuses mode 4 unless the deployment can carry it: the common gate must be on Attention, both sides must have the same rank count between 1 and 32, three AIV cores are needed, and the operator probe must have said yes. The FFN receive refuses the token-ids slot in this mode, because the router and the shared experts need the model dtype. Quantizing the final wire tensor keeps the scale covering exactly the rows the operator sends; mode 4 cannot reach the padding branch because it requires equal rank counts. The scale travels with the routing, so prepare pads, gathers and shards it by the same rule as the activation rows. What consumes it fixes the layout: ALLGATHER re-lays it as (rows, cols // 2, 2) for the fused GMM, while MC2 hands the two-dimensional scale to its dispatch operator. MC2 gets a dispatcher subclass that forwards the scale and selects quant_mode=0 instead of letting upstream quantize an activation that already is; an explicit comm_quant_mode that disagrees is rejected rather than overruled. The tests drive the real prepare transforms and the real FFN entry point, with only the connector payload supplied, and pin the bytes the experts read: every scale row carries different values, so a transform that reorders, pads or re-lays it cannot keep them in place. This branch has no NPU run. The operator that accepts x_scale and quant_mode lives in vllm-project#444, so the mode is wired and reviewed but unverified on hardware. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
connector_extra_config.quant_mode=4 quantizes the Attention activation to E4M3 inside the opaque A2E call, ships it with its E8M0 MX scale, and hands the pair to the experts on the FFN side without dequantizing. Mode 0 keeps the twelve-argument BF16 call, so an operator build that predates the MXFP8 arguments still runs. Construction refuses mode 4 unless the deployment can carry it: the common gate must be on Attention, both sides must have the same rank count between 1 and 32, three AIV cores are needed, and the operator probe must have said yes. The FFN receive refuses the token-ids slot in this mode, because the router and the shared experts need the model dtype. Quantizing the final wire tensor keeps the scale covering exactly the rows the operator sends; mode 4 cannot reach the padding branch because it requires equal rank counts. The scale travels with the routing, so prepare pads, gathers and shards it by the same rule as the activation rows. What consumes it fixes the layout: ALLGATHER re-lays it as (rows, cols // 2, 2) for the fused GMM, while MC2 hands the two-dimensional scale to its dispatch operator. MC2 gets a dispatcher subclass that forwards the scale and selects quant_mode=0 instead of letting upstream quantize an activation that already is; an explicit comm_quant_mode that disagrees is rejected rather than overruled. The tests drive the real prepare transforms and the real FFN entry point, with only the connector payload supplied, and pin the bytes the experts read: every scale row carries different values, so a transform that reorders, pads or re-lays it cannot keep them in place. This branch has no NPU run. The operator that accepts x_scale and quant_mode lives in vllm-project#444, so the mode is wired and reviewed but unverified on hardware. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
connector_extra_config.quant_mode=4 quantizes the Attention activation to E4M3 inside the opaque A2E call, ships it with its E8M0 MX scale, and hands the pair to the experts on the FFN side without dequantizing. Mode 0 keeps the twelve-argument BF16 call, so an operator build that predates the MXFP8 arguments still runs. Construction refuses mode 4 unless the deployment can carry it: the common gate must be on Attention, both sides must have the same rank count between 1 and 32, three AIV cores are needed, and the operator probe must have said yes. The FFN receive refuses the token-ids slot in this mode, because the router and the shared experts need the model dtype. Quantizing the final wire tensor keeps the scale covering exactly the rows the operator sends; mode 4 cannot reach the padding branch because it requires equal rank counts. The scale travels with the routing, so prepare pads, gathers and shards it by the same rule as the activation rows. What consumes it fixes the layout: ALLGATHER re-lays it as (rows, cols // 2, 2) for the fused GMM, while MC2 hands the two-dimensional scale to its dispatch operator. MC2 gets a dispatcher subclass that forwards the scale and selects quant_mode=0 instead of letting upstream quantize an activation that already is; an explicit comm_quant_mode that disagrees is rejected rather than overruled. The tests drive the real prepare transforms and the real FFN entry point, with only the connector payload supplied, and pin the bytes the experts read: every scale row carries different values, so a transform that reorders, pads or re-lays it cannot keep them in place. This branch has no NPU run. The operator that accepts x_scale and quant_mode lives in vllm-project#444, so the mode is wired and reviewed but unverified on hardware. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
connector_extra_config.quant_mode=4 quantizes the Attention activation to E4M3 inside the opaque A2E call, ships it with its E8M0 MX scale, and hands the pair to the experts on the FFN side without dequantizing. Mode 0 keeps the twelve-argument BF16 call, so an operator build that predates the MXFP8 arguments still runs. Construction refuses mode 4 unless the deployment can carry it: the common gate must be on Attention, both sides must have the same rank count between 1 and 32, three AIV cores are needed, and the operator probe must have said yes. The FFN receive refuses the token-ids slot in this mode, because the router and the shared experts need the model dtype. Quantizing the final wire tensor keeps the scale covering exactly the rows the operator sends; mode 4 cannot reach the padding branch because it requires equal rank counts. The scale travels with the routing, so prepare pads, gathers and shards it by the same rule as the activation rows. What consumes it fixes the layout: ALLGATHER re-lays it as (rows, cols // 2, 2) for the fused GMM, while MC2 hands the two-dimensional scale to its dispatch operator. MC2 gets a dispatcher subclass that forwards the scale and selects quant_mode=0 instead of letting upstream quantize an activation that already is; an explicit comm_quant_mode that disagrees is rejected rather than overruled. The tests drive the real prepare transforms and the real FFN entry point, with only the connector payload supplied, and pin the bytes the experts read: every scale row carries different values, so a transform that reorders, pads or re-lays it cannot keep them in place. This branch has no NPU run. The operator that accepts x_scale and quant_mode lives in vllm-project#444, so the mode is wired and reviewed but unverified on hardware. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
|
Long-term this operator needs three fixes. The first two are confirmable from the source in this 1. Make an A/F protocol mismatch fail loudly instead of reading another rank's bytes or hanging. The F side derives the remote packet offset from its own Suggested fix: validate the fixed part of the protocol at the control plane -- protocol version, 2. Apply the routing-id capacity and core-count constraints to both modes, not only to MXFP8. Both modes pull the whole id block into one UB region on the receive side The core split has a matching hole. With Please make both modes reject these two inputs first; large-batch support can follow by giving the id 3. Version the new native interface.
Secondary, not a blocker: On the device tests: the existing A5 case passes an empty E8M0 tensor where #506's FFN call passes |
Both roles read their own `connector_extra_config.quant_mode`, and each side's value is individually legal, so an Attention role on 4 with an FFN role on 0 passed both local checks while the two A2E packet layouts differ in the activation offset and the element width. The FFN rank would read the peer's bytes as its own mode and hand the experts a silently wrong activation. The control payload now carries the sender's mode, and the FFN role compares it with its own in `recv_dp_metadata_list` -- the step the FFN worker runs before its first forward, hence before the first A2E call. A peer that declares no mode reads as 0, so an older Attention process is a mismatch rather than a silent downgrade. `quant_mode=4` also required a way to see a device whose operator build lacks the path: the operator registers the same fourteen-argument schema on every build and rejects mode 4 only at runtime, so the construction gate now checks for an Ascend A5 device as well. The dtype half of that build check needs a capability marker from the operator side (vllm-project#444); until it exists this remains a documented requirement rather than a check. Tests: the mixed 4/0 pair fails at the handshake, a matching pair passes, the send side declares its own mode, the codec round-trips the field and defaults a missing one to 0, and the A5 check rejects another device family. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
|
One more ask from the #506 side, related to point 1's protocol handshake: please expose the operator build's MXFP8 capability. The fourteen-argument schema is registered unconditionally, so a Python caller cannot tell an A5 build with E4M3/E5M2/E8M0 support from one that rejects A compile-time constant or a tiny exported predicate (for example |
Both roles read their own `connector_extra_config.quant_mode`, and each value is individually legal, so an Attention role on 4 with an FFN role on 0 passed both local checks while the two A2E packet layouts differ in the activation offset and the element width. The FFN rank would read the peer's bytes as its own mode and hand the experts a silently wrong activation. Two checks, in the order they bite: - `init_afd_connector` gathers every rank's mode over the AFD group and fails them all when the set is not a singleton. Every rank joins that group, so the 4/0 and 0/4 pairs both fail here -- before profile, capture and the first A2E call -- rather than leaving the Attention side waiting for an E2A the FFN side will never send. - The control payload also carries the sender's mode, and the FFN role compares it in `recv_dp_metadata_list`. That path covers a peer that started before the group handshake existed; a payload without the field reads as 0, which is the right answer only for a peer that never had mode 4. A `5041bd5` peer does have it, so the handshake above is the one that keeps that combination from being silently accepted. `quant_mode=4` also needed a way to see a device whose operator build lacks the path: the operator registers the same fourteen-argument schema on every build and rejects mode 4 only at runtime, so the construction gate now checks for an Ascend A5 device. The dtype half of that build check needs a capability marker from the operator side (vllm-project#444); until it exists this stays a documented requirement rather than a check. Tests: ranks must agree on the mode (4/0 and 0/4 both raise), the mixed pair fails at the handshake, a matching pair passes, the send side declares its own mode, the codec round-trips the field and defaults a missing one to 0, and the A5 check rejects another device family. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
Both roles read their own `connector_extra_config.quant_mode`, and each value is individually legal, so an Attention role on 4 with an FFN role on 0 passed both local checks while the two A2E packet layouts differ in the activation offset and the element width. The FFN rank would read the peer's bytes as its own mode and hand the experts a silently wrong activation. Two checks, in the order they bite: - `init_afd_connector` gathers every rank's mode over the AFD group and fails them all when the set is not a singleton. Every rank joins that group, so the 4/0 and 0/4 pairs both fail here -- before profile, capture and the first A2E call -- rather than leaving the Attention side waiting for an E2A the FFN side will never send. - The control payload also carries the sender's mode, and the FFN role compares it in `recv_dp_metadata_list`. That path covers a peer that started before the group handshake existed; a payload without the field reads as 0, which is the right answer only for a peer that never had mode 4. A `5041bd5` peer does have it, so the handshake above is the one that keeps that combination from being silently accepted. `quant_mode=4` also needed a way to see a device whose operator build lacks the path: the operator registers the same fourteen-argument schema on every build and rejects mode 4 only at runtime, so the construction gate now checks for an Ascend A5 device. The dtype half of that build check needs a capability marker from the operator side (vllm-project#444); until it exists this stays a documented requirement rather than a check. Tests: ranks must agree on the mode (4/0 and 0/4 both raise), the mixed pair fails at the handshake, a matching pair passes, the send side declares its own mode, the codec round-trips the field and defaults a missing one to 0, and the A5 check rejects another device family. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
Both roles read their own `connector_extra_config.quant_mode`, and each value is individually legal, so an Attention role on 4 with an FFN role on 0 passed both local checks while the two A2E packet layouts differ in the activation offset and the element width. The FFN rank would read the peer's bytes as its own mode and hand the experts a silently wrong activation. Two checks, in the order they bite: - `init_afd_connector` gathers every rank's mode over the AFD group and fails them all when the set is not a singleton. Every rank joins that group, so the 4/0 and 0/4 pairs both fail here -- before profile, capture and the first A2E call -- rather than leaving the Attention side waiting for an E2A the FFN side will never send. - The control payload also carries the sender's mode, and the FFN role compares it in `recv_dp_metadata_list`. That path covers a peer that started before the group handshake existed; a payload without the field reads as 0, which is the right answer only for a peer that never had mode 4. A `5041bd5` peer does have it, so the handshake above is the one that keeps that combination from being silently accepted. `quant_mode=4` also needed a way to see a device whose operator build lacks the path: the operator registers the same fourteen-argument schema on every build and rejects mode 4 only at runtime, so the construction gate now checks for an Ascend A5 device. The dtype half of that build check needs a capability marker from the operator side (vllm-project#444); until it exists this stays a documented requirement rather than a check. Tests: ranks must agree on the mode (4/0 and 0/4 both raise), the mixed pair fails at the handshake, a matching pair passes, the send side declares its own mode, the codec round-trips the field and defaults a missing one to 0, and the A5 check rejects another device family. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
Both roles read their own `connector_extra_config.quant_mode`, and each value is individually legal, so an Attention role on 4 with an FFN role on 0 passed both local checks while the two A2E packet layouts differ in the activation offset and the element width. The FFN rank would read the peer's bytes as its own mode and hand the experts a silently wrong activation. Two checks, in the order they bite: - `init_afd_connector` gathers every rank's mode over the AFD group and fails them all when the set is not a singleton. Every rank joins that group, so the 4/0 and 0/4 pairs both fail here -- before profile, capture and the first A2E call -- rather than leaving the Attention side waiting for an E2A the FFN side will never send. - The control payload also carries the sender's mode, and the FFN role compares it in `recv_dp_metadata_list`. That path covers a peer that started before the group handshake existed; a payload without the field reads as 0, which is the right answer only for a peer that never had mode 4. A `5041bd5` peer does have it, so the handshake above is the one that keeps that combination from being silently accepted. `quant_mode=4` also needed a way to see a device whose operator build lacks the path: the operator registers the same fourteen-argument schema on every build and rejects mode 4 only at runtime, so the construction gate now checks for an Ascend A5 device. The dtype half of that build check needs a capability marker from the operator side (vllm-project#444); until it exists this stays a documented requirement rather than a check. Tests: ranks must agree on the mode (4/0 and 0/4 both raise), the mixed pair fails at the handshake, a matching pair passes, the send side declares its own mode, the codec round-trips the field and defaults a missing one to 0, and the A5 check rejects another device family. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
Both roles read their own `connector_extra_config.quant_mode`, and each value is individually legal, so an Attention role on 4 with an FFN role on 0 passed both local checks while the two A2E packet layouts differ in the activation offset and the element width. The FFN rank would read the peer's bytes as its own mode and hand the experts a silently wrong activation. Two checks, in the order they bite: - `init_afd_connector` gathers every rank's mode over the AFD group and fails them all when the set is not a singleton. Every rank joins that group, so the 4/0 and 0/4 pairs both fail here -- before profile, capture and the first A2E call -- rather than leaving the Attention side waiting for an E2A the FFN side will never send. - The control payload also carries the sender's mode, and the FFN role compares it in `recv_dp_metadata_list`. That path covers a peer that started before the group handshake existed; a payload without the field reads as 0, which is the right answer only for a peer that never had mode 4. A `5041bd5` peer does have it, so the handshake above is the one that keeps that combination from being silently accepted. `quant_mode=4` also needed a way to see a device whose operator build lacks the path: the operator registers the same fourteen-argument schema on every build and rejects mode 4 only at runtime, so the construction gate now checks for an Ascend A5 device. The dtype half of that build check needs a capability marker from the operator side (vllm-project#444); until it exists this stays a documented requirement rather than a check. Tests: ranks must agree on the mode (4/0 and 0/4 both raise), the mixed pair fails at the handshake, a matching pair passes, the send side declares its own mode, the codec round-trips the field and defaults a missing one to 0, and the A5 check rejects another device family. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
Both roles read their own `connector_extra_config.quant_mode`, and each value is individually legal, so an Attention role on 4 with an FFN role on 0 passed both local checks while the two A2E packet layouts differ in the activation offset and the element width. The FFN rank would read the peer's bytes as its own mode and hand the experts a silently wrong activation. Two checks, in the order they bite: - `init_afd_connector` gathers every rank's mode over the AFD group and fails them all when the set is not a singleton. Every rank joins that group, so the 4/0 and 0/4 pairs both fail here -- before profile, capture and the first A2E call -- rather than leaving the Attention side waiting for an E2A the FFN side will never send. - The control payload also carries the sender's mode, and the FFN role compares it in `recv_dp_metadata_list`. That path covers a peer that started before the group handshake existed; a payload without the field reads as 0, which is the right answer only for a peer that never had mode 4. A `5041bd5` peer does have it, so the handshake above is the one that keeps that combination from being silently accepted. `quant_mode=4` also needed a way to see a device whose operator build lacks the path: the operator registers the same fourteen-argument schema on every build and rejects mode 4 only at runtime, so the construction gate now checks for an Ascend A5 device. The dtype half of that build check needs a capability marker from the operator side (vllm-project#444); until it exists this stays a documented requirement rather than a check. Tests: ranks must agree on the mode (4/0 and 0/4 both raise), the mixed pair fails at the handshake, a matching pair passes, the send side declares its own mode, the codec round-trips the field and defaults a missing one to 0, and the A5 check rejects another device family. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
Both roles read their own `connector_extra_config.quant_mode`, and each value is individually legal, so an Attention role on 4 with an FFN role on 0 passed both local checks while the two A2E packet layouts differ in the activation offset and the element width. The FFN rank would read the peer's bytes as its own mode and hand the experts a silently wrong activation. Two checks, in the order they bite: - `init_afd_connector` gathers every rank's mode over the AFD group and fails them all when the set is not a singleton. Every rank joins that group, so the 4/0 and 0/4 pairs both fail here -- before profile, capture and the first A2E call -- rather than leaving the Attention side waiting for an E2A the FFN side will never send. - The control payload also carries the sender's mode, and the FFN role compares it in `recv_dp_metadata_list`. That path covers a peer that started before the group handshake existed; a payload without the field reads as 0, which is the right answer only for a peer that never had mode 4. A `5041bd5` peer does have it, so the handshake above is the one that keeps that combination from being silently accepted. `quant_mode=4` also needed a way to see a device whose operator build lacks the path: the operator registers the same fourteen-argument schema on every build and rejects mode 4 only at runtime, so the construction gate now checks for an Ascend A5 device. The dtype half of that build check needs a capability marker from the operator side (vllm-project#444); until it exists this stays a documented requirement rather than a check. Tests: ranks must agree on the mode (4/0 and 0/4 both raise), the mixed pair fails at the handshake, a matching pair passes, the send side declares its own mode, the codec round-trips the field and defaults a missing one to 0, and the A5 check rejects another device family. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
Both roles read their own `connector_extra_config.quant_mode`, and each value is individually legal, so an Attention role on 4 with an FFN role on 0 passed both local checks while the two A2E packet layouts differ in the activation offset and the element width. The FFN rank would read the peer's bytes as its own mode and hand the experts a silently wrong activation. Two checks, in the order they bite: - `init_afd_connector` gathers every rank's mode over the AFD group and fails them all when the set is not a singleton. Every rank joins that group, so the 4/0 and 0/4 pairs both fail here -- before profile, capture and the first A2E call -- rather than leaving the Attention side waiting for an E2A the FFN side will never send. - The control payload also carries the sender's mode, and the FFN role compares it in `recv_dp_metadata_list`. That path covers a peer that started before the group handshake existed; a payload without the field reads as 0, which is the right answer only for a peer that never had mode 4. A `5041bd5` peer does have it, so the handshake above is the one that keeps that combination from being silently accepted. `quant_mode=4` also needed a way to see a device whose operator build lacks the path: the operator registers the same fourteen-argument schema on every build and rejects mode 4 only at runtime, so the construction gate now checks for an Ascend A5 device. The dtype half of that build check needs a capability marker from the operator side (vllm-project#444); until it exists this stays a documented requirement rather than a check. Tests: ranks must agree on the mode (4/0 and 0/4 both raise), the mixed pair fails at the handshake, a matching pair passes, the send side declares its own mode, the codec round-trips the field and defaults a missing one to 0, and the A5 check rejects another device family. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
connector_extra_config.quant_mode=4 quantizes the Attention activation to E4M3 inside the opaque A2E call, ships it with its E8M0 MX scale, and hands the pair to the experts on the FFN side without dequantizing. Mode 0 keeps the twelve-argument BF16 call, so an operator build that predates the MXFP8 arguments still runs. Construction refuses mode 4 unless the deployment can carry it: the common gate must be on Attention, both sides must have the same rank count between 1 and 32, three AIV cores are needed, and the operator probe must have said yes. The FFN receive refuses the token-ids slot in this mode, because the router and the shared experts need the model dtype. Quantizing the final wire tensor keeps the scale covering exactly the rows the operator sends; mode 4 cannot reach the padding branch because it requires equal rank counts. The scale travels with the routing, so prepare pads, gathers and shards it by the same rule as the activation rows. What consumes it fixes the layout: ALLGATHER re-lays it as (rows, cols // 2, 2) for the fused GMM, while MC2 hands the two-dimensional scale to its dispatch operator. MC2 gets a dispatcher subclass that forwards the scale and selects quant_mode=0 instead of letting upstream quantize an activation that already is; an explicit comm_quant_mode that disagrees is rejected rather than overruled. The tests drive the real prepare transforms and the real FFN entry point, with only the connector payload supplied, and pin the bytes the experts read: every scale row carries different values, so a transform that reorders, pads or re-lays it cannot keep them in place. This branch has no NPU run. The operator that accepts x_scale and quant_mode lives in vllm-project#444, so the mode is wired and reviewed but unverified on hardware. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
Both roles read their own `connector_extra_config.quant_mode`, and each value is individually legal, so an Attention role on 4 with an FFN role on 0 passed both local checks while the two A2E packet layouts differ in the activation offset and the element width. The FFN rank would read the peer's bytes as its own mode and hand the experts a silently wrong activation. Two checks, in the order they bite: - `init_afd_connector` gathers every rank's mode over the AFD group and fails them all when the set is not a singleton. Every rank joins that group, so the 4/0 and 0/4 pairs both fail here -- before profile, capture and the first A2E call -- rather than leaving the Attention side waiting for an E2A the FFN side will never send. - The control payload also carries the sender's mode, and the FFN role compares it in `recv_dp_metadata_list`. That path covers a peer that started before the group handshake existed; a payload without the field reads as 0, which is the right answer only for a peer that never had mode 4. A `5041bd5` peer does have it, so the handshake above is the one that keeps that combination from being silently accepted. `quant_mode=4` also needed a way to see a device whose operator build lacks the path: the operator registers the same fourteen-argument schema on every build and rejects mode 4 only at runtime, so the construction gate now checks for an Ascend A5 device. The dtype half of that build check needs a capability marker from the operator side (vllm-project#444); until it exists this stays a documented requirement rather than a check. Tests: ranks must agree on the mode (4/0 and 0/4 both raise), the mixed pair fails at the handshake, a matching pair passes, the send side declares its own mode, the codec round-trips the field and defaults a missing one to 0, and the A5 check rejects another device family. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
connector_extra_config.quant_mode=4 quantizes the Attention activation to E4M3 inside the opaque A2E call, ships it with its E8M0 MX scale, and hands the pair to the experts on the FFN side without dequantizing. Mode 0 keeps the twelve-argument BF16 call, so an operator build that predates the MXFP8 arguments still runs. Construction refuses mode 4 unless the deployment can carry it: the common gate must be on Attention, both sides must have the same rank count between 1 and 32, three AIV cores are needed, and the operator probe must have said yes. The FFN receive refuses the token-ids slot in this mode, because the router and the shared experts need the model dtype. Quantizing the final wire tensor keeps the scale covering exactly the rows the operator sends; mode 4 cannot reach the padding branch because it requires equal rank counts. The scale travels with the routing, so prepare pads, gathers and shards it by the same rule as the activation rows. What consumes it fixes the layout: ALLGATHER re-lays it as (rows, cols // 2, 2) for the fused GMM, while MC2 hands the two-dimensional scale to its dispatch operator. MC2 gets a dispatcher subclass that forwards the scale and selects quant_mode=0 instead of letting upstream quantize an activation that already is; an explicit comm_quant_mode that disagrees is rejected rather than overruled. The tests drive the real prepare transforms and the real FFN entry point, with only the connector payload supplied, and pin the bytes the experts read: every scale row carries different values, so a transform that reorders, pads or re-lays it cannot keep them in place. This branch has no NPU run. The operator that accepts x_scale and quant_mode lives in vllm-project#444, so the mode is wired and reviewed but unverified on hardware. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
Both roles read their own `connector_extra_config.quant_mode`, and each value is individually legal, so an Attention role on 4 with an FFN role on 0 passed both local checks while the two A2E packet layouts differ in the activation offset and the element width. The FFN rank would read the peer's bytes as its own mode and hand the experts a silently wrong activation. Two checks, in the order they bite: - `init_afd_connector` gathers every rank's mode over the AFD group and fails them all when the set is not a singleton. Every rank joins that group, so the 4/0 and 0/4 pairs both fail here -- before profile, capture and the first A2E call -- rather than leaving the Attention side waiting for an E2A the FFN side will never send. - The control payload also carries the sender's mode, and the FFN role compares it in `recv_dp_metadata_list`. That path covers a peer that started before the group handshake existed; a payload without the field reads as 0, which is the right answer only for a peer that never had mode 4. A `5041bd5` peer does have it, so the handshake above is the one that keeps that combination from being silently accepted. `quant_mode=4` also needed a way to see a device whose operator build lacks the path: the operator registers the same fourteen-argument schema on every build and rejects mode 4 only at runtime, so the construction gate now checks for an Ascend A5 device. The dtype half of that build check needs a capability marker from the operator side (vllm-project#444); until it exists this stays a documented requirement rather than a check. Tests: ranks must agree on the mode (4/0 and 0/4 both raise), the mixed pair fails at the handshake, a matching pair passes, the send side declares its own mode, the codec round-trips the field and defaults a missing one to 0, and the A5 check rejects another device family. Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
PLEASE FILL IN THE PR DESCRIPTION AND MAKE SURE THE CHECKLIST ITEMS HAVE BEEN CONSIDERED.
Purpose
Issue
Scope
Implementation Notes
Test Plan
Test Result
Docs Impact
Essential PR Checklist