Omer Yahud
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
      • 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 No publishing access yet

        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.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        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 New
      • Engagement control
      • Make a copy
      • 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 Note Insights Versions and GitHub Sync Sharing URL Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Engagement control Make a copy 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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Mutually Exclusive Device Allocations in DRA ## Summary This document proposes an extension to the Dynamic Resource Allocation (DRA) API to support mutually exclusive device allocation constraints. ## Motivation Hardware devices often support multiple partitioning or virtualization schemes that provide different trade-offs in terms of isolation, performance, and resource sharing. However, these schemes are frequently mutually exclusive at the hardware level—once a physical device is partitioned or configured using one scheme, it cannot be reconfigured to use a different scheme until all existing allocations are released. ### Goals - Allow DRA drivers to specify compatibility between virtual devices within a single physical device - Allow the scheduler to make informed allocation decisions that respect compatibility rules - Provide a generic mechanism applicable to any hardware with partitioning constraints - Maintain backward compatibility with existing ResourceSlice specifications ### Non Goals - Allow DRA drivers to specify compatibility between physical/virtual devices across different phisical devices or device classes ### Problem Statement The current Partitionable Devices API does not provide a mechanism to express mutual exclusivity constraints between devices. Without this capability: 1. **Late Failure Detection**: Incompatible allocations are only detected during resource preparation (after scheduling decisions are made) 2. **Scheduler Unawareness**: The scheduler may allocate incompatible devices, leading to pod startup failures 3. **Poor User Experience**: Users receive cryptic preparation failures instead of clear scheduling feedback 4. **Resource Thrashing**: The scheduler may repeatedly attempt incompatible allocations **Current Workaround Limitations:** DRA drivers must fail resource preparation when incompatible allocations are attempted. ### Use Case **Generic Example:** Consider a physical accelerator device that supports four distinct operational modes, in all cases, **Partitionable Devices** is utilized: 1. **Exclusive Mode**: The entire physical device allocated to a single consumer 2. **Software-Partitioned Mode A** : Multiple consumers share the physical device through virtual devices 3. **Software-Partitioned Mode B** : Multiple consumers share the physical device through virtual devices 4. **Hardware-Partitioned Mode**: The device is divided into distinct isolated hardware partitions These modes have compatibility constraints: - **Exclusive Mode** is incompatible with all other modes - **Software-Partitioned Mode A** may be compatible with **Software-Partitioned Mode B**, but not with exclusive and hardware partitioning modes - **Hardware-Partitioned Mode** creates fixed partitions that cannot coexist with other partitioning modes The constraint is bidirectional and transitive: if partition mode A excludes partition mode B, then allocating A must prevent B from being allocated, and vice versa. #### GPU Example ```yaml apiVersion: resource.k8s.io/v1 kind: ResourceSlice ... spec: sharedCounters: # This counter set represents a specific physical device. - name: gpu-0-cs counters: multiprocessors: value: "152" devices: # Incompatible with any other partitioning schemes - name: gpu-0 bindsToNode: true consumesCounters: - counterSet: gpu-0-cs counters: multiprocessors: value: "152" attributes: partitioningMode: string: None # Incompatible with MIGSlicing and None partitioning modes, # but compatible with MPSSharing mode - name: gpu-0-fraction-0 bindsToNode: true allowMultipleAllocations: true consumesCounters: - counterSet: gpu-0-cs counters: multiprocessors: value: "76" capacity: ... attributes: partitioningMode: string: GPUFractioning # Incompatible with any other partitioning modes, only compatible with devices # partitioned with the same mode (MIGSlicing) - name: gpu-0-mig-1g.5gb-0 bindsToNode: true consumesCounters: - counterSet: gpu-0-cs counters: multiprocessors: value: "2" attributes: partitioningMode: string: MIGSlicing # Incompatible with any other partitioning modes, only compatible with devices # partitioned with the same mode (MIGSlicing) - name: gpu-0-mig-1g.5gb-1 bindsToNode: true consumesCounters: - counterSet: gpu-0-cs counters: multiprocessors: value: "2" attributes: partitioningMode: string: MIGSlicing # Incompatible with the MIGSlicing and None # partitioning modes, but compatible with GPUFractioning - name: gpu-0-mps-0 bindsToNode: true allowMultipleAllocations: true consumesCounters: - counterSet: gpu-0-cs counters: multiprocessors: value: "15" capacity: ... attributes: partitioningMode: string: MPSSharing ``` ## Proposal 1 - CompatibilityGroups Assignment ### API Changes Add the `device.consumesCounters[].compatibilityGroups` field which specifies which device groups this device is compatible with. Other devices must specify at least one `compatibilityGroup` from this list to be considered compatible. #### Field Structure ```yaml apiVersion: resource.k8s.io/v1 kind: ResourceSlice ... spec: sharedCounters: # This counter set represents a specific, physical device. - name: gpu-1-cs counters: multiprocessors: value: "152" devices: # Full, physical device. Consumes full counter set `gpu-1-cs`. - name: gpu-1 attributes: type: string: gpu consumesCounters: - counterSet: gpu-1-cs counters: multiprocessors: value: "152" # MIG partition. This cannot be allocated # - when device `gpu-1` is allocated # (reason: counters exhausted) # - when device `gpu-1-foo-part` is allocated # (reason: mismatching compatibilityGroups) - name: gpu-1-mig1 attributes: type: string: mig consumesCounters: - counterSet: gpu-1-cs # Can only consume from the same counter set when # all existing consumers also list compatibilityGroup "mig". compatibilityGroups: - mig counters: multiprocessors: value: "2" # FOO partition. This cannot be allocated # - when device `gpu-1` is allocated # (reason: counters exhausted). # - when device `gpu-1-mig1` is allocated # (reason: mismatching compatibilityGroups). # # This can generally still be allocated # - when `gpu-1-bar-part` is allocated # (reason: shared compatibilityGroups "bar"). # # The relationship between the foo and bar type # partitions on the same physical device is # modeled by counter consumption. - name: gpu-1-foo-part attributes: type: string: foo consumesCounters: - counterSet: gpu-1-cs compatibilityGroups: - foo - bar counters: multiprocessors: value: "17" # BAR paritition. Similar considerations as # described for FOO partition. - name: gpu-1-bar-part attributes: type: string: bar consumesCounters: - counterSet: gpu-1-cs compatibilityGroups: - bar counters: multiprocessors: value: "2" ``` ### Semantics #### Device Groupings 1. **Group Declaration**: Devices must declare which groups they are compatible with, otherwise they are assumed compatible with all groups. 3. **Scope**: Grouping rules apply: - To all devices within a device class, that specify `compatibilityGroups` - Across all resource claims 4. **Scheduler Enforcement**: The scheduler must: - Evaluate exclusion constraints during device selection - Skip device candidates that would violate existing allocations - Track allocated devices and their exclusion rules ## Proposal 2 - Attribute-based Compatibility with CEL ### API Changes Add an optional `compatibleOnlyWith` field to device objects within the ResourceSlice specification. This field allows devices to declare which other devices can be allocated alongside them. If not provided, a device is deemed compatible with all other devices to preserve backwards compatibility #### Field Structure ```yaml devices: - name: device-name # ... existing device fields ... # New field: compatibleOnlyWith # Specifies a CEL expression that the scheduler filters devices with when attempting # a device allocation. # This field is optional. If not specified, the device has no compatibility constraints. compatibleOnlyWith: expression: "cel exp" ``` ### Semantics #### Exclusion Rules 1. **Mutual Exclusivity**: If device A specifies a compatibility expression, scheduler must: - Evaluate the expression against already allocated devices when the device is considered for allocation - Evaluate the expression against devices that are considered for allocation if a device with an expression is already allocated 3. **Scope**: Compatibility expressions apply: - To all devices within a device class - Across all resource claims #### Example Exclusion Patterns **Pattern 1: Device-Level Exclusivity** ```yaml - name: device-full attributes: physicalDevice: dev-0 # Excludes all devices whos underlying device is dev-0 compatibleOnlyWith: expression: 'device.attributes["device.example.com"].physicalDevice != "dev-0"' ``` **Pattern 2: Mode-Based Exclusivity** ```yaml - name: dev-0-partition-1 attributes: physicalDevice: dev-0 mode: hardware-partitioned # Only compatible with specific paritioning modes compatibleOnlyWith: expression: 'device.attributes["device.example.com"].mode == "hardware-partitioned"' ``` ## Proposal Comparison **Attribute-based Compatibility with CEL** - **Higher degree of freedom**: - Device compatibility can be defined in a multi-dimentional way, not only physical device placement - Can be extended to support additional use cases in the future (maybe across device-classes?) **CompatibilityGroups Assignment** - **Cleaner and simpler implementation** - Minimal additions to the API and codebase that solve the problem at hand ## Implementation Considerations ### Scheduler Changes The DRA scheduler plugin must be enhanced to: 1. **Track Allocated Devices**: Maintain a cache of allocated devices per node with their attributes and compatibility expressions, or group mapping 2. **Evaluate Exclusions**: For each candidate device: - Check if all allocated devices are copmatible with this candidate - Check if this candidate is compatible with all allocated devices 3. **Filter Candidates**: Remove devices from consideration if they violate compatibility constraints 4. **Handle Allocation Failures**: If an incompatible device is allocated, provide clear feedback in scheduling events ### Driver Responsibilities Resource drivers should: 1. **Declare Constraints**: Populate `compatibleOnlyWith` or `compatibilityGroups` for all devices with compatibility requirements 2. **Validation**: Ensure compatibility rules are symmetric and consistent across devices 4. **Documentation**: Document their compatibility matrix ### Backward Compatibility - Both approaches are opt-in - Devices without `compatibleOnlyWith` or `compatibilityGroups` behave identically to current behavior - No changes to existing API fields or semantics - Older schedulers will ignore the new field but may allocate incompatible devices (same as current behavior)

    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
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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