Doge
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    ###### tags: `HPCAI` # RDMA Transport & introduction to Software interface [TOC] ## RDMA 基本概念 - 最主要的想法 - 略過中間人 ( Kernel ) - 為甚麼發展 RDMA - 還是有 Kernel 的 overhead - 左邊的 U-net 還是必須經過 kernel mode - Socket buffer - TCP stack - 組裝 header - 右邊的 RDMA 直接 "by pass" "zero copy" 過 Kernel mode ![](https://i.imgur.com/Azh7KZU.png) - 基本原則 - RDMA 直接傳送流量到 NIC ( 網路卡 ) 上,不會 interrupting CPU - 遠端使用的 MR 會先被遠端的 NIC 註冊 - NIC 會記住 VA -> PA 的 page mapping ( 記憶體 ) - 當遠端的 NIC 接到 request ,就會透過 DMA 得到資訊,並回傳資料給發出 request 的機器 - 兩邊因為都透過 RDMA 消除掉了 kernel 的影響 ( Kerenl bypass ) ## RDMA standards - IB - 在超級電腦的世界中使用越來越多 - 昂貴的設備,需要支援 IB 的網卡、 switch ... - 200Gb/s standard - RDMA over Converged Ethernet ( RoCE ) - 比較便宜,但仍需要專用網卡 - 200 Gb/s ( and 60Gb/s ) - RoCE 要擴張規模看起來效果比較不好 - iWARP - RDMA over TCP - 最糟糕的效能 ## Data Transfer Modal - Work Queues :::info 當我們沒有 socket 、 tcp/ip 該怎麼讓所有 node 都獲得資料 ? <br> 先從剛剛的 socket 來講好了,我們會先創建 socket( `socket()` ) 、 寫入資料到 socket 。 socket 的 read 和 write 是 blocked 的。 ::: - Work Request ( WR ) - non-blocked request - hardware 實作出來的 - 因為不想要在 kernel 有一些複製的操作 - Work Completetion ( WC ) - 當 WR 被完成時,產生一個 WC - 包括很多資訊 - type - opcode - data 傳輸、接收量 - more... - Work Queue ( WQ ) - 一個 queue 包括 WRs - SQ 跟 RQ 都是 WQ - 先後順序由 hardware 去做編排 - 不同 WQ 裡面執行的順序**不一定**和 WR 請求的順序相同 - 同一個 WQ 裡面執行的順序**會**和 WR 請求的順序相同 - 可以是 send Queue 或 receive Queue - send Queue + receive Queue => queue pair ( QP ) - 增加 WR 到 WQ 這個動作被稱作 "posting a WR" - post 這個動作指的不只是傳送資料 ( Send ) ,也可以是接收資料 ( Recv ),重點是都是增加 WR 到 WQ。 - 當我的 WR 被 post 時,他就被認為是 "outstanding" , 直到出現 WC - outstanding 的特性 - One can not know if it was scheduled by the HW or not - send buffer 在 outstanding 時是唯讀的 - receive buffer 在 outstanding 時, buffer 內的資料有可能是無意義的 - Send Queue ( SQ ) - 專門處理**發送 ( sending )** RDMA message 的 queue - 每一個 SQ 裡面的 entry 都被稱作 Send Request ( SR ) ,定義了以下幾種資訊 - data 怎麼用 - memory buffer 怎麼用 - send - receive 用哪個 buffer 主要由當初 send Request ( SR ) 的 opcode 決定 - 我要送多少資料過去? ( 100 bytes? 200 bytes? ) - more... - 在 SQ 裡面加入一個 SR 稱作 "posting a send request" - SR 可能會在 work completion ( WC ) 時結束 - Receive Queue ( RQ ) - 專門處理**接收 ( income )** RDMA message 的 queue - 每一個 RQ 裡面的 entry 都被稱作 Receive Request ( RR ) ,定義了以下幾種資訊 - 怎麼用 memory buffer ? - 跟剛剛 SQ 一樣,都是取決於 opcode - 在 RQ 裡面加入一個 RR 稱作 "posting a send request" - SR 一定會在 work completion ( WC ) 時結束 - Queue Pair ( QP ) - 一個 object 包含 Send Queue 和 Receive Queue - 每一個 Queue 都是獨立的 - 每一個 QP 都包含著 Partition Key ( P_Key ) > not discussed ![](https://i.imgur.com/VsuNTT8.png) ## data transfer Modal - the parties - **Requester** - **主動發起 ( initiates )** WR 的一方,不代表他一定是要資料的模式 ( WRITE/SEND ), 取決於 opcode - Post Send Request - **Responder** - **被動接受** WR 的一方,不代表他一定是傳輸資料的模式 ( READ/RECV ), 取決於 opcode - May Post Receive Request ( RR ) - 發出 ACK / NACK 來維持可靠的連線

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully