Skip to content

Commit

Permalink
fix: missing load the maxGaudi2DevicesPerContainer (#2681)
Browse files Browse the repository at this point in the history
### TL;DR

This PR resolves the bug where `maxGaudi2DevicesPerContainer` was not being applied.
- Load the client configuration to include the `maxGaudi2DevicesPerContainer` value.
  • Loading branch information
yomybaby committed Sep 3, 2024
1 parent 289da35 commit 7a8202d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/backend-ai-login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export default class BackendAILogin extends BackendAIPage {
@property({ type: Number }) maxIPUDevicesPerContainer = 8;
@property({ type: Number }) maxATOMDevicesPerContainer = 8;
@property({ type: Number }) maxWarboyDevicesPerContainer = 8;
@property({ type: Number }) maxGaudi2DevicesPerContainer = 8;
@property({ type: Number }) maxShmPerContainer = 2;
@property({ type: Number }) maxFileUploadSize = -1;
@property({ type: Boolean }) maskUserInfo = false;
Expand Down Expand Up @@ -986,6 +987,16 @@ export default class BackendAILogin extends BackendAIPage {
} as ConfigValueObject,
) as number;

// Max Gaudi 2 devices per container number
this.maxGaudi2DevicesPerContainer = this._getConfigValueByExists(
resourcesConfig,
{
valueType: 'number',
defaultValue: 8,
value: parseInt(resourcesConfig?.maxGaudi2DevicesPerContainer),
} as ConfigValueObject,
) as number;

// Max Warboy devices per container number
this.maxWarboyDevicesPerContainer = this._getConfigValueByExists(
resourcesConfig,
Expand Down Expand Up @@ -1825,6 +1836,8 @@ export default class BackendAILogin extends BackendAIPage {
this.maxIPUDevicesPerContainer;
globalThis.backendaiclient._config.maxATOMDevicesPerContainer =
this.maxATOMDevicesPerContainer;
globalThis.backendaiclient._config.maxGaudi2DevicesPerContainer =
this.maxGaudi2DevicesPerContainer;
globalThis.backendaiclient._config.maxWarboyDevicesPerContainer =
this.maxWarboyDevicesPerContainer;
globalThis.backendaiclient._config.maxShmPerContainer =
Expand Down

0 comments on commit 7a8202d

Please sign in to comment.