vllm.distributed.engram_pool.verbs
¶
ctypes bindings to libibverbs: just enough for RC QPs and RDMA WRITEs.
Structs and constants mirror rdma-core's verbs.h and mlx5dv.h under their C
names (LP64 ABI), as pynccl_wrapper does for NCCL. ibv_post_send,
ibv_post_recv, ibv_poll_cq and ibv_req_notify_cq are inline in verbs.h,
so they are called through the context's ops table. Only the standard library
is imported: the RDMA proxy process loads this file without vllm or torch.
Classes:
-
Device–One opened RDMA device and protection domain on port 1.
-
ibv_context–Up to the ops called here; the skipped ops are
_compat_*stubs or -
ibv_qp–Up to the fields read here.
-
ibv_send_wr–With
wr.rdmaof thewrunion. RDMA WRITEs and READs leave the -
mlx5dv_obj–Its
qpmember'sinandout; the other members stay null. -
mlx5dv_qp_queue–The
sqandrqmembers of struct mlx5dv_qp.
Functions:
-
active_devices–Names of mlx5 RDMA devices (the WQEs we build are mlx5's) whose port 1
-
local_cpus–CPUs on the device's NUMA node.
Device
¶
One opened RDMA device and protection domain on port 1.
Methods:
-
connect–Move a QP through INIT, RTR and RTS towards
remote_qpn. -
cq_event–Sleep until the next event of
channeland consume it. -
create_cq–A CQ, and if
wakeablea completion channel (else 0) whose events -
create_qp–An RC QP; it receives only WRITE_WITH_IMM notices. Returns it and
-
mlx5_queue–An mlx5 QP's send queue, doorbell record and BlueFlame register, for
-
notify_cq–Raise one event on the CQ's channel at its next completion.
-
reg_host–Register memory with
accessNIC_READ, PEER_WRITE or PEER_ORDERED;
Attributes:
Source code in vllm/distributed/engram_pool/verbs.py
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 | |
mtu_bytes
property
¶
The path MTU (enum ibv_mtu) in bytes.
connect(qp, remote_qpn, remote)
¶
Move a QP through INIT, RTR and RTS towards remote_qpn.
Source code in vllm/distributed/engram_pool/verbs.py
cq_event(channel)
¶
Sleep until the next event of channel and consume it.
Source code in vllm/distributed/engram_pool/verbs.py
create_cq(depth, wakeable=False)
¶
A CQ, and if wakeable a completion channel (else 0) whose events
(cq_event) wake a sleeper.
Source code in vllm/distributed/engram_pool/verbs.py
create_qp(send_cq, recv_cq, max_send_wr, max_send_sge=1, max_inline=0, max_recv_wr=1)
¶
An RC QP; it receives only WRITE_WITH_IMM notices. Returns it and its number.
Source code in vllm/distributed/engram_pool/verbs.py
mlx5_queue(qp)
staticmethod
¶
An mlx5 QP's send queue, doorbell record and BlueFlame register, for posting without libibverbs.
Source code in vllm/distributed/engram_pool/verbs.py
notify_cq(cq)
¶
Raise one event on the CQ's channel at its next completion.
reg_host(address, num_bytes, access)
¶
Register memory with access NIC_READ, PEER_WRITE or PEER_ORDERED;
returns its lkey and rkey.
Source code in vllm/distributed/engram_pool/verbs.py
ibv_context
¶
Bases: Structure
Up to the ops called here; the skipped ops are _compat_* stubs or
unused.
Source code in vllm/distributed/engram_pool/verbs.py
ibv_qp
¶
ibv_send_wr
¶
Bases: Structure
With wr.rdma of the wr union. RDMA WRITEs and READs leave the
trailing bind_mw/tso union (spare) unused.
Source code in vllm/distributed/engram_pool/verbs.py
mlx5dv_obj
¶
Bases: Structure
Its qp member's in and out; the other members stay null.
Source code in vllm/distributed/engram_pool/verbs.py
mlx5dv_qp_queue
¶
_pick_gid_index(device)
¶
RoCE v2 with an IPv4-mapped address if present, else index 0 (IB).
Source code in vllm/distributed/engram_pool/verbs.py
active_devices()
¶
Names of mlx5 RDMA devices (the WQEs we build are mlx5's) whose port 1 is active. By driver, since udev may rename devices.
Source code in vllm/distributed/engram_pool/verbs.py
local_cpus(device)
¶
CPUs on the device's NUMA node.