Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(FR-55): Support ai.backend.accelerators image label's * value #3089

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yomybaby
Copy link
Member

@yomybaby yomybaby commented Feb 3, 2025

resolves #2781 (FR-55)

Uses supported_accelerators information from the image instead of currentImageAcceleratorLimits to determine available accelerator types in the session launcher. This provides more accurate accelerator compatibility information based on the image's declared support.

Key changes:

  • Filters available accelerator types based on image's supported_accelerators field
  • Renames resourceLimits to mergedResourceLimit for clarity
  • Updates preset allocation logic to consider supported accelerators
  • Adds wildcard support (*) for images that support all accelerator types

Checklist:

  • Documentation
  • Minium required manager version: 24.12.0
  • Test case: Verify accelerator options are filtered correctly based on image's supported_accelerators field

@github-actions github-actions bot added the size:L 100~500 LoC label Feb 3, 2025
Copy link
Member Author

yomybaby commented Feb 3, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

github-actions bot commented Feb 3, 2025

Coverage report for ./react

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements
4.98% (+0.08% 🔼)
405/8126
🔴 Branches
4.33% (+0.09% 🔼)
244/5638
🔴 Functions
3.06% (+0.11% 🔼)
81/2647
🔴 Lines
4.89% (+0.07% 🔼)
389/7949

Test suite run failed

Failed tests: 4/124. Failed suites: 1/14.
  ● getAllocatablePresetNames › should return presets when currentImage has accelerator limits

    expect(received).toEqual(expected) // deep equality

    - Expected  - 3
    + Received  + 1

    - Array [
    -   "cuda_shares_prest_1",
    - ]
    + Array []

      61 |     );
      62 |     //  must compare the preset's resource slots with the resource limits even `check-preset` result has allocatable.
    > 63 |     expect(result).toEqual(['cuda_shares_prest_1']);
         |                    ^
      64 |   });
      65 |
      66 |   it('should return empty array when no presets match', () => {

      at Object.<anonymous> (src/components/ResourceAllocationFormItems.test.ts:63:20)

  ● getAllocatablePresetNames › should handle empty resourceLimits

    expect(received).toEqual(expected) // deep equality

    - Expected  - 4
    + Received  + 1

    - Array [
    -   "cuda_shares_prest_10",
    -   "cuda_shares_prest_1",
    - ]
    + Array []

      101 |     );
      102 |     // Only presets that have cuda.shares minimum 1 should be returned.
    > 103 |     expect(result).toEqual(['cuda_shares_prest_10', 'cuda_shares_prest_1']);
          |                    ^
      104 |   });
      105 |
      106 |   it('should handle empty image', () => {

      at Object.<anonymous> (src/components/ResourceAllocationFormItems.test.ts:103:20)

  ● getAllocatablePresetNames › should handle empty image

    expect(received).toEqual(expected) // deep equality

    - Expected  - 4
    + Received  + 1

    - Array [
    -   "cuda_shares_prest_1",
    -   "cpu1_mem2g",
    - ]
    + Array []

      111 |     );
      112 |     // Only compare with resource limits
    > 113 |     expect(result).toEqual(['cuda_shares_prest_1', 'cpu1_mem2g']);
          |                    ^
      114 |   });
      115 |
      116 |   it('should handle empty image and small mem limit', () => {

      at Object.<anonymous> (src/components/ResourceAllocationFormItems.test.ts:113:20)

  ● getAllocatablePresetNames › should handle empty image and small mem limit

    expect(received).toEqual(expected) // deep equality

    - Expected  - 3
    + Received  + 1

    - Array [
    -   "cpu1_mem2g",
    - ]
    + Array []

      124 |     );
      125 |     // Only compare with resource limits
    > 126 |     expect(result).toEqual(['cpu1_mem2g']);
          |                    ^
      127 |   });
      128 | });
      129 |

      at Object.<anonymous> (src/components/ResourceAllocationFormItems.test.ts:126:20)

Report generated by 🧪jest coverage report action from 1cd4b5b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L 100~500 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support ai.backend.accelerators image label's * value
1 participant