feat: add gpu_selector field
This commit is contained in:
@@ -3,6 +3,7 @@ import { PipelineType } from '@huggingface/tasks';
|
|||||||
import { request } from '@umijs/max';
|
import { request } from '@umijs/max';
|
||||||
import {
|
import {
|
||||||
FormData,
|
FormData,
|
||||||
|
GPUListItem,
|
||||||
ListItem,
|
ListItem,
|
||||||
ModelInstanceFormData,
|
ModelInstanceFormData,
|
||||||
ModelInstanceListItem
|
ModelInstanceListItem
|
||||||
@@ -24,6 +25,12 @@ export async function queryModelsList(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function queryGPUList() {
|
||||||
|
return request<Global.PageResponse<GPUListItem>>(`/gpu-devices`, {
|
||||||
|
methos: 'GET'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export async function createModel(params: { data: FormData }) {
|
export async function createModel(params: { data: FormData }) {
|
||||||
return request(`${MODELS_API}`, {
|
return request(`${MODELS_API}`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|||||||
@@ -0,0 +1,262 @@
|
|||||||
|
import LabelSelector from '@/components/label-selector';
|
||||||
|
import SealSelect from '@/components/seal-form/seal-select';
|
||||||
|
import { InfoCircleOutlined, RightOutlined } from '@ant-design/icons';
|
||||||
|
import { useIntl } from '@umijs/max';
|
||||||
|
import {
|
||||||
|
Checkbox,
|
||||||
|
Collapse,
|
||||||
|
Form,
|
||||||
|
FormInstance,
|
||||||
|
Select,
|
||||||
|
Tooltip,
|
||||||
|
Typography
|
||||||
|
} from 'antd';
|
||||||
|
import React, { useCallback, useMemo } from 'react';
|
||||||
|
import { placementStrategyOptions } from '../config';
|
||||||
|
import { FormData } from '../config/types';
|
||||||
|
import dataformStyles from '../style/data-form.less';
|
||||||
|
import GPUCard from './gpu-card';
|
||||||
|
|
||||||
|
interface AdvanceConfigProps {
|
||||||
|
form: FormInstance;
|
||||||
|
gpuOptions: Array<any>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
||||||
|
const { form, gpuOptions } = props;
|
||||||
|
|
||||||
|
const intl = useIntl();
|
||||||
|
const wokerSelector = Form.useWatch('worker_selector', form);
|
||||||
|
const scheduleType = Form.useWatch('scheduleType', form);
|
||||||
|
|
||||||
|
const placementStrategyTips = [
|
||||||
|
{
|
||||||
|
title: 'Spread',
|
||||||
|
tips: intl.formatMessage({
|
||||||
|
id: 'resources.form.spread.tips'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Binpack',
|
||||||
|
tips: intl.formatMessage({
|
||||||
|
id: 'resources.form.binpack.tips'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const scheduleTypeTips = [
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({
|
||||||
|
id: 'models.form.scheduletype.auto'
|
||||||
|
}),
|
||||||
|
tips: intl.formatMessage({
|
||||||
|
id: 'models.form.scheduletype.auto.tips'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({
|
||||||
|
id: 'models.form.scheduletype.manual'
|
||||||
|
}),
|
||||||
|
tips: intl.formatMessage({
|
||||||
|
id: 'models.form.scheduletype.manual.tips'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const renderSelectTips = (list: Array<{ title: string; tips: string }>) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{list.map((item, index) => {
|
||||||
|
return (
|
||||||
|
<div className="m-b-8" key={index}>
|
||||||
|
<Typography.Title
|
||||||
|
level={5}
|
||||||
|
style={{
|
||||||
|
color: 'var(--color-white-1)',
|
||||||
|
marginRight: 10
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{item.title}:
|
||||||
|
</Typography.Title>
|
||||||
|
<Typography.Text style={{ color: 'var(--color-white-1)' }}>
|
||||||
|
{item.tips}
|
||||||
|
</Typography.Text>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleWorkerLabelsChange = useCallback(
|
||||||
|
(labels: Record<string, any>) => {
|
||||||
|
form.setFieldValue('worker_selector', labels);
|
||||||
|
},
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
|
const collapseItems = useMemo(() => {
|
||||||
|
const children = (
|
||||||
|
<>
|
||||||
|
<Form.Item name="scheduleType">
|
||||||
|
<SealSelect
|
||||||
|
label={intl.formatMessage({ id: 'models.form.scheduletype' })}
|
||||||
|
description={renderSelectTips(scheduleTypeTips)}
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
label: intl.formatMessage({
|
||||||
|
id: 'models.form.scheduletype.auto'
|
||||||
|
}),
|
||||||
|
value: 'auto'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: intl.formatMessage({
|
||||||
|
id: 'models.form.scheduletype.manual'
|
||||||
|
}),
|
||||||
|
value: 'manual'
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
></SealSelect>
|
||||||
|
</Form.Item>
|
||||||
|
{scheduleType === 'auto' && (
|
||||||
|
<Form.Item<FormData> name="placement_strategy">
|
||||||
|
<SealSelect
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'resources.form.placementStrategy'
|
||||||
|
})}
|
||||||
|
options={placementStrategyOptions}
|
||||||
|
description={renderSelectTips(placementStrategyTips)}
|
||||||
|
></SealSelect>
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
{scheduleType === 'auto' && (
|
||||||
|
<Form.Item<FormData> name="worker_selector">
|
||||||
|
<LabelSelector
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'resources.form.workerSelector'
|
||||||
|
})}
|
||||||
|
labels={wokerSelector}
|
||||||
|
onChange={handleWorkerLabelsChange}
|
||||||
|
description={
|
||||||
|
<span>
|
||||||
|
{intl.formatMessage({
|
||||||
|
id: 'resources.form.workerSelector.description'
|
||||||
|
})}
|
||||||
|
</span>
|
||||||
|
}
|
||||||
|
></LabelSelector>
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
{scheduleType === 'manual' && (
|
||||||
|
<Form.Item<FormData>
|
||||||
|
name="gpu_selector"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: intl.formatMessage(
|
||||||
|
{
|
||||||
|
id: 'common.form.rule.select'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'gpu_selector'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<SealSelect label="GPU Selector" required>
|
||||||
|
{gpuOptions.map((item) => (
|
||||||
|
<Select.Option key={item.value} value={item.value}>
|
||||||
|
<GPUCard data={item}></GPUCard>
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</SealSelect>
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
<div style={{ marginBottom: 22, paddingLeft: 10 }}>
|
||||||
|
<Form.Item<FormData>
|
||||||
|
name="partial_offload"
|
||||||
|
valuePropName="checked"
|
||||||
|
style={{ padding: '0 10px', marginBottom: 0 }}
|
||||||
|
noStyle
|
||||||
|
>
|
||||||
|
<Checkbox className="p-l-6">
|
||||||
|
<Tooltip
|
||||||
|
title={intl.formatMessage({
|
||||||
|
id: 'models.form.partialoffload.tips'
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<span style={{ color: 'var(--ant-color-text-tertiary)' }}>
|
||||||
|
{intl.formatMessage({
|
||||||
|
id: 'resources.form.enablePartialOffload'
|
||||||
|
})}
|
||||||
|
</span>
|
||||||
|
<InfoCircleOutlined
|
||||||
|
className="m-l-4"
|
||||||
|
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
</Checkbox>
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
{scheduleType === 'auto' && (
|
||||||
|
<div style={{ marginBottom: 22, paddingLeft: 10 }}>
|
||||||
|
<Form.Item<FormData>
|
||||||
|
name="distributed_inference_across_workers"
|
||||||
|
valuePropName="checked"
|
||||||
|
style={{ padding: '0 10px', marginBottom: 0 }}
|
||||||
|
noStyle
|
||||||
|
>
|
||||||
|
<Checkbox className="p-l-6">
|
||||||
|
<Tooltip
|
||||||
|
title={intl.formatMessage({
|
||||||
|
id: 'models.form.distribution.tips'
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<span style={{ color: 'var(--ant-color-text-tertiary)' }}>
|
||||||
|
{intl.formatMessage({
|
||||||
|
id: 'resources.form.enableDistributedInferenceAcrossWorkers'
|
||||||
|
})}
|
||||||
|
</span>
|
||||||
|
<InfoCircleOutlined
|
||||||
|
className="m-l-4"
|
||||||
|
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
</Checkbox>
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
key: '1',
|
||||||
|
label: (
|
||||||
|
<span style={{ fontWeight: 'var(--font-weight-medium)' }}>
|
||||||
|
{intl.formatMessage({ id: 'resources.form.advanced' })}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
children
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}, [scheduleType]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Collapse
|
||||||
|
expandIconPosition="start"
|
||||||
|
bordered={false}
|
||||||
|
ghost
|
||||||
|
className={dataformStyles['advanced-collapse']}
|
||||||
|
expandIcon={({ isActive }) => (
|
||||||
|
<RightOutlined
|
||||||
|
rotate={isActive ? 90 : 0}
|
||||||
|
style={{ fontSize: '12px' }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
items={collapseItems}
|
||||||
|
></Collapse>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AdvanceConfig;
|
||||||
@@ -1,28 +1,21 @@
|
|||||||
import LabelSelector from '@/components/label-selector';
|
|
||||||
import SealAutoComplete from '@/components/seal-form/auto-complete';
|
import SealAutoComplete from '@/components/seal-form/auto-complete';
|
||||||
import SealInput from '@/components/seal-form/seal-input';
|
import SealInput from '@/components/seal-form/seal-input';
|
||||||
import SealSelect from '@/components/seal-form/seal-select';
|
import SealSelect from '@/components/seal-form/seal-select';
|
||||||
import { PageAction } from '@/config';
|
import { PageAction } from '@/config';
|
||||||
import { PageActionType } from '@/config/types';
|
import { PageActionType } from '@/config/types';
|
||||||
import { InfoCircleOutlined, RightOutlined } from '@ant-design/icons';
|
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Checkbox, Collapse, Form, Select, Tooltip, Typography } from 'antd';
|
import { Form } from 'antd';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import React, {
|
import React, {
|
||||||
forwardRef,
|
forwardRef,
|
||||||
useCallback,
|
|
||||||
useEffect,
|
useEffect,
|
||||||
useImperativeHandle,
|
useImperativeHandle,
|
||||||
useMemo
|
useState
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import {
|
import { queryGPUList } from '../apis';
|
||||||
modelSourceMap,
|
import { modelSourceMap, ollamaModelOptions } from '../config';
|
||||||
ollamaModelOptions,
|
import { FormData, GPUListItem } from '../config/types';
|
||||||
placementStrategyOptions
|
import AdvanceConfig from './advance-config';
|
||||||
} from '../config';
|
|
||||||
import { FormData } from '../config/types';
|
|
||||||
import dataformStyles from '../style/data-form.less';
|
|
||||||
import GPUCard from './gpu-card';
|
|
||||||
|
|
||||||
interface DataFormProps {
|
interface DataFormProps {
|
||||||
ref?: any;
|
ref?: any;
|
||||||
@@ -45,109 +38,29 @@ const sourceOptions = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const gpuOptions = [
|
|
||||||
{
|
|
||||||
label: 'NVIDIA A100',
|
|
||||||
value: '1',
|
|
||||||
index: 0,
|
|
||||||
worker_name: 'mbp-1.local',
|
|
||||||
worker: {
|
|
||||||
GPU: {
|
|
||||||
name: 'A100',
|
|
||||||
count: 1,
|
|
||||||
memory: 16384
|
|
||||||
},
|
|
||||||
CPU: {
|
|
||||||
count: 16,
|
|
||||||
memory: 16384
|
|
||||||
},
|
|
||||||
os: {
|
|
||||||
name: 'Ubuntu 20.04',
|
|
||||||
version: '20.04'
|
|
||||||
},
|
|
||||||
name: 'mbp-1.local',
|
|
||||||
address: '192.168.1.1'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'NVIDIA H100',
|
|
||||||
value: '2',
|
|
||||||
index: 1,
|
|
||||||
worker_name: 'mbp-2.local',
|
|
||||||
worker: {
|
|
||||||
GPU: {
|
|
||||||
name: 'H100',
|
|
||||||
count: 1,
|
|
||||||
memory: 16384
|
|
||||||
},
|
|
||||||
CPU: {
|
|
||||||
count: 16,
|
|
||||||
memory: 16384
|
|
||||||
},
|
|
||||||
os: {
|
|
||||||
name: 'Ubuntu 20.04',
|
|
||||||
version: '20.04'
|
|
||||||
},
|
|
||||||
name: 'mbp-2.local',
|
|
||||||
address: '192.168.1.2'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'NVIDIA A100',
|
|
||||||
value: '3',
|
|
||||||
index: 2,
|
|
||||||
worker_name: 'mbp-3.local',
|
|
||||||
worker: {
|
|
||||||
GPU: {
|
|
||||||
name: 'A100',
|
|
||||||
count: 1,
|
|
||||||
memory: 16384
|
|
||||||
},
|
|
||||||
CPU: {
|
|
||||||
count: 16,
|
|
||||||
memory: 16384
|
|
||||||
},
|
|
||||||
os: {
|
|
||||||
name: 'Ubuntu 20.04',
|
|
||||||
version: '20.04'
|
|
||||||
},
|
|
||||||
name: 'mbp-3.local',
|
|
||||||
address: '192.168.1.3'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'NVIDIA H100',
|
|
||||||
value: '4',
|
|
||||||
index: 3,
|
|
||||||
worker_name: 'mbp-4.local',
|
|
||||||
worker: {
|
|
||||||
GPU: {
|
|
||||||
name: 'H100',
|
|
||||||
count: 1,
|
|
||||||
memory: 16384
|
|
||||||
},
|
|
||||||
CPU: {
|
|
||||||
count: 16,
|
|
||||||
memory: 16384
|
|
||||||
},
|
|
||||||
os: {
|
|
||||||
name: 'Ubuntu 20.04',
|
|
||||||
version: '20.04'
|
|
||||||
},
|
|
||||||
name: 'mbp-4.local',
|
|
||||||
address: '192.168.1.4'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||||
const { action, repo, onOk } = props;
|
const { action, repo, onOk } = props;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const wokerSelector = Form.useWatch('worker_selector', form);
|
const [gpuOptions, setGpuOptions] = useState<
|
||||||
// const [scheduleType, setScheduleType] = React.useState(false); // false: auto, true: manual
|
Array<GPUListItem & { label: string; value: string }>
|
||||||
|
>([]);
|
||||||
|
|
||||||
const scheduleType = Form.useWatch('scheduleType', form);
|
const getGPUList = async () => {
|
||||||
|
const data = await queryGPUList();
|
||||||
|
const list = _.map(data.items, (item: GPUListItem) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
label: item.name,
|
||||||
|
value: item.name
|
||||||
|
};
|
||||||
|
});
|
||||||
|
setGpuOptions(list);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getGPUList();
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleSumit = () => {
|
const handleSumit = () => {
|
||||||
form.submit();
|
form.submit();
|
||||||
@@ -172,40 +85,6 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
const placementStrategyTips = [
|
|
||||||
{
|
|
||||||
title: 'Spread',
|
|
||||||
tips: intl.formatMessage({
|
|
||||||
id: 'resources.form.spread.tips'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Binpack',
|
|
||||||
tips: intl.formatMessage({
|
|
||||||
id: 'resources.form.binpack.tips'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
const scheduleTypeTips = [
|
|
||||||
{
|
|
||||||
title: intl.formatMessage({
|
|
||||||
id: 'models.form.scheduletype.auto'
|
|
||||||
}),
|
|
||||||
tips: intl.formatMessage({
|
|
||||||
id: 'models.form.scheduletype.auto.tips'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: intl.formatMessage({
|
|
||||||
id: 'models.form.scheduletype.manual'
|
|
||||||
}),
|
|
||||||
tips: intl.formatMessage({
|
|
||||||
id: 'models.form.scheduletype.manual.tips'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
const handleOnSelectModel = () => {
|
const handleOnSelectModel = () => {
|
||||||
console.log('repo=============', repo);
|
console.log('repo=============', repo);
|
||||||
if (!repo) {
|
if (!repo) {
|
||||||
@@ -228,13 +107,6 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleWorkerLabelsChange = useCallback(
|
|
||||||
(labels: Record<string, any>) => {
|
|
||||||
form.setFieldValue('worker_selector', labels);
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
const renderHuggingfaceFields = () => {
|
const renderHuggingfaceFields = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -355,163 +227,26 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderSelectTips = (list: Array<{ title: string; tips: string }>) => {
|
const handleOk = (formdata: FormData) => {
|
||||||
return (
|
const gpu = _.find(gpuOptions, (item: any) => {
|
||||||
<div>
|
return item.value === formdata.gpu_selector;
|
||||||
{list.map((item, index) => {
|
});
|
||||||
return (
|
if (gpu) {
|
||||||
<div className="m-b-8" key={index}>
|
onOk({
|
||||||
<Typography.Title
|
..._.omit(formdata, ['scheduleType']),
|
||||||
level={5}
|
gpu_selector: {
|
||||||
style={{
|
gpu_name: gpu.name,
|
||||||
color: 'var(--color-white-1)',
|
gpu_index: gpu.index,
|
||||||
marginRight: 10
|
worker_name: gpu.worker_name
|
||||||
}}
|
}
|
||||||
>
|
});
|
||||||
{item.title}:
|
} else {
|
||||||
</Typography.Title>
|
onOk({
|
||||||
<Typography.Text style={{ color: 'var(--color-white-1)' }}>
|
..._.omit(formdata, ['scheduleType'])
|
||||||
{item.tips}
|
});
|
||||||
</Typography.Text>
|
}
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const collapseItems = useMemo(() => {
|
|
||||||
const children = (
|
|
||||||
<>
|
|
||||||
<Form.Item name="scheduleType">
|
|
||||||
<SealSelect
|
|
||||||
label={intl.formatMessage({ id: 'models.form.scheduletype' })}
|
|
||||||
description={renderSelectTips(scheduleTypeTips)}
|
|
||||||
options={[
|
|
||||||
{
|
|
||||||
label: intl.formatMessage({
|
|
||||||
id: 'models.form.scheduletype.auto'
|
|
||||||
}),
|
|
||||||
value: 'auto'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: intl.formatMessage({
|
|
||||||
id: 'models.form.scheduletype.manual'
|
|
||||||
}),
|
|
||||||
value: 'manual'
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
></SealSelect>
|
|
||||||
</Form.Item>
|
|
||||||
{scheduleType === 'auto' && (
|
|
||||||
<Form.Item<FormData> name="placement_strategy">
|
|
||||||
<SealSelect
|
|
||||||
label={intl.formatMessage({
|
|
||||||
id: 'resources.form.placementStrategy'
|
|
||||||
})}
|
|
||||||
options={placementStrategyOptions}
|
|
||||||
description={renderSelectTips(placementStrategyTips)}
|
|
||||||
></SealSelect>
|
|
||||||
</Form.Item>
|
|
||||||
)}
|
|
||||||
{scheduleType === 'auto' && (
|
|
||||||
<Form.Item<FormData> name="worker_selector">
|
|
||||||
<LabelSelector
|
|
||||||
label={intl.formatMessage({
|
|
||||||
id: 'resources.form.workerSelector'
|
|
||||||
})}
|
|
||||||
labels={wokerSelector}
|
|
||||||
onChange={handleWorkerLabelsChange}
|
|
||||||
description={
|
|
||||||
<span>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: 'resources.form.workerSelector.description'
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
}
|
|
||||||
></LabelSelector>
|
|
||||||
</Form.Item>
|
|
||||||
)}
|
|
||||||
{scheduleType === 'manual' && (
|
|
||||||
<Form.Item<FormData> name="gpu_selector">
|
|
||||||
<SealSelect label="GPU Selector">
|
|
||||||
{gpuOptions.map((item) => (
|
|
||||||
<Select.Option key={item.value} value={item.value}>
|
|
||||||
<GPUCard data={item}></GPUCard>
|
|
||||||
</Select.Option>
|
|
||||||
))}
|
|
||||||
</SealSelect>
|
|
||||||
</Form.Item>
|
|
||||||
)}
|
|
||||||
<div style={{ marginBottom: 22, paddingLeft: 10 }}>
|
|
||||||
<Form.Item<FormData>
|
|
||||||
name="partial_offload"
|
|
||||||
valuePropName="checked"
|
|
||||||
style={{ padding: '0 10px', marginBottom: 0 }}
|
|
||||||
noStyle
|
|
||||||
>
|
|
||||||
<Checkbox className="p-l-6">
|
|
||||||
<Tooltip
|
|
||||||
title={intl.formatMessage({
|
|
||||||
id: 'models.form.partialoffload.tips'
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<span style={{ color: 'var(--ant-color-text-tertiary)' }}>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: 'resources.form.enablePartialOffload'
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
<InfoCircleOutlined
|
|
||||||
className="m-l-4"
|
|
||||||
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
</Checkbox>
|
|
||||||
</Form.Item>
|
|
||||||
</div>
|
|
||||||
{scheduleType === 'auto' && (
|
|
||||||
<div style={{ marginBottom: 22, paddingLeft: 10 }}>
|
|
||||||
<Form.Item<FormData>
|
|
||||||
name="distributed_inference_across_workers"
|
|
||||||
valuePropName="checked"
|
|
||||||
style={{ padding: '0 10px', marginBottom: 0 }}
|
|
||||||
noStyle
|
|
||||||
>
|
|
||||||
<Checkbox className="p-l-6">
|
|
||||||
<Tooltip
|
|
||||||
title={intl.formatMessage({
|
|
||||||
id: 'models.form.distribution.tips'
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<span style={{ color: 'var(--ant-color-text-tertiary)' }}>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: 'resources.form.enableDistributedInferenceAcrossWorkers'
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
<InfoCircleOutlined
|
|
||||||
className="m-l-4"
|
|
||||||
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
</Checkbox>
|
|
||||||
</Form.Item>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
key: '1',
|
|
||||||
label: (
|
|
||||||
<span style={{ fontWeight: 'var(--font-weight-medium)' }}>
|
|
||||||
{intl.formatMessage({ id: 'resources.form.advanced' })}
|
|
||||||
</span>
|
|
||||||
),
|
|
||||||
children
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}, [scheduleType]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleOnSelectModel();
|
handleOnSelectModel();
|
||||||
}, [repo]);
|
}, [repo]);
|
||||||
@@ -520,7 +255,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
|||||||
<Form
|
<Form
|
||||||
name="deployModel"
|
name="deployModel"
|
||||||
form={form}
|
form={form}
|
||||||
onFinish={onOk}
|
onFinish={handleOk}
|
||||||
preserve={false}
|
preserve={false}
|
||||||
style={{ padding: '16px 24px' }}
|
style={{ padding: '16px 24px' }}
|
||||||
clearOnDestroy={true}
|
clearOnDestroy={true}
|
||||||
@@ -528,9 +263,9 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
|||||||
replicas: 1,
|
replicas: 1,
|
||||||
source: props.source,
|
source: props.source,
|
||||||
placement_strategy: 'spread',
|
placement_strategy: 'spread',
|
||||||
partial_offload: true,
|
partial_offload: false,
|
||||||
scheduleType: 'auto',
|
scheduleType: 'auto',
|
||||||
distributed_inference_across_workers: true
|
distributed_inference_across_workers: false
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Form.Item<FormData>
|
<Form.Item<FormData>
|
||||||
@@ -612,20 +347,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
|||||||
})}
|
})}
|
||||||
></SealInput.TextArea>
|
></SealInput.TextArea>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<AdvanceConfig form={form} gpuOptions={gpuOptions}></AdvanceConfig>
|
||||||
<Collapse
|
|
||||||
expandIconPosition="start"
|
|
||||||
bordered={false}
|
|
||||||
ghost
|
|
||||||
className={dataformStyles['advanced-collapse']}
|
|
||||||
expandIcon={({ isActive }) => (
|
|
||||||
<RightOutlined
|
|
||||||
rotate={isActive ? 90 : 0}
|
|
||||||
style={{ fontSize: '12px', marginLeft: -8 }}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
items={collapseItems}
|
|
||||||
></Collapse>
|
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,9 +13,11 @@ const GPUCard: React.FC<{
|
|||||||
</div>
|
</div>
|
||||||
<div className="info">
|
<div className="info">
|
||||||
<span>VRAM:</span>
|
<span>VRAM:</span>
|
||||||
<span>Total {convertFileSize(22906503168)}</span>
|
<span>Total {convertFileSize(data?.memory?.total || 0)}</span>
|
||||||
<span>Used {convertFileSize(3322640640)}</span>
|
<span>Used {convertFileSize(data?.memory?.used || 0)}</span>
|
||||||
<span>Utilization {_.round(3.79, 2)}%</span>
|
<span>
|
||||||
|
Utilization {_.round(data?.memory?.utilization_rate || 0, 2)}%
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,23 +1,20 @@
|
|||||||
import LabelSelector from '@/components/label-selector';
|
|
||||||
import ModalFooter from '@/components/modal-footer';
|
import ModalFooter from '@/components/modal-footer';
|
||||||
import SealAutoComplete from '@/components/seal-form/auto-complete';
|
import SealAutoComplete from '@/components/seal-form/auto-complete';
|
||||||
import FormItemWrapper from '@/components/seal-form/components/wrapper';
|
|
||||||
import SealInput from '@/components/seal-form/seal-input';
|
import SealInput from '@/components/seal-form/seal-input';
|
||||||
import SealSelect from '@/components/seal-form/seal-select';
|
import SealSelect from '@/components/seal-form/seal-select';
|
||||||
import { PageAction } from '@/config';
|
import { PageAction } from '@/config';
|
||||||
import { PageActionType } from '@/config/types';
|
import { PageActionType } from '@/config/types';
|
||||||
import { convertFileSize } from '@/utils';
|
import { convertFileSize } from '@/utils';
|
||||||
import { InfoCircleOutlined, RightOutlined } from '@ant-design/icons';
|
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Checkbox, Collapse, Form, Modal, Tooltip, Typography } from 'antd';
|
import { Form, Modal } from 'antd';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { memo, useCallback, useEffect, useState } from 'react';
|
import { memo, useEffect, useState } from 'react';
|
||||||
import SimpleBar from 'simplebar-react';
|
import SimpleBar from 'simplebar-react';
|
||||||
import 'simplebar-react/dist/simplebar.min.css';
|
import 'simplebar-react/dist/simplebar.min.css';
|
||||||
import { queryHuggingfaceModelFiles, queryHuggingfaceModels } from '../apis';
|
import { queryGPUList, queryHuggingfaceModelFiles } from '../apis';
|
||||||
import { modelSourceMap, placementStrategyOptions } from '../config';
|
import { modelSourceMap } from '../config';
|
||||||
import { FormData, ListItem } from '../config/types';
|
import { FormData, GPUListItem, ListItem } from '../config/types';
|
||||||
import dataformStyles from '../style/data-form.less';
|
import AdvanceConfig from './advance-config';
|
||||||
|
|
||||||
type AddModalProps = {
|
type AddModalProps = {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -46,16 +43,25 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
const { title, action, open, onOk, onCancel } = props || {};
|
const { title, action, open, onOk, onCancel } = props || {};
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
const [gpuOptions, setGpuOptions] = useState<any[]>([]);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const modelSource = Form.useWatch('source', form);
|
const modelSource = Form.useWatch('source', form);
|
||||||
const wokerSelector = Form.useWatch('worker_selector', form);
|
|
||||||
const [repoOptions, setRepoOptions] = useState<
|
|
||||||
{ label: string; value: string }[]
|
|
||||||
>([]);
|
|
||||||
const [fileOptions, setFileOptions] = useState<
|
const [fileOptions, setFileOptions] = useState<
|
||||||
{ label: string; value: string }[]
|
{ label: string; value: string }[]
|
||||||
>([]);
|
>([]);
|
||||||
|
|
||||||
|
const getGPUList = async () => {
|
||||||
|
const data = await queryGPUList();
|
||||||
|
const list = _.map(data.items, (item: GPUListItem) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
label: item.name,
|
||||||
|
value: item.name
|
||||||
|
};
|
||||||
|
});
|
||||||
|
setGpuOptions(list);
|
||||||
|
};
|
||||||
|
|
||||||
const initFormValue = () => {
|
const initFormValue = () => {
|
||||||
if (action === PageAction.CREATE && open) {
|
if (action === PageAction.CREATE && open) {
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
@@ -65,7 +71,8 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
}
|
}
|
||||||
if (action === PageAction.EDIT && open) {
|
if (action === PageAction.EDIT && open) {
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
...props.data
|
...props.data,
|
||||||
|
scheduleType: props.data?.gpu_selector ? 'manual' : 'auto'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -112,32 +119,6 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
handleFetchModelFiles(repo);
|
handleFetchModelFiles(repo);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOnSearchRepo = async (text: string) => {
|
|
||||||
try {
|
|
||||||
const params = {
|
|
||||||
search: {
|
|
||||||
query: text,
|
|
||||||
tags: ['gguf']
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const models = await queryHuggingfaceModels(params);
|
|
||||||
const list = _.map(models || [], (item: any) => {
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
value: item.name,
|
|
||||||
label: item.name
|
|
||||||
};
|
|
||||||
});
|
|
||||||
setRepoOptions(list);
|
|
||||||
} catch (error) {
|
|
||||||
setRepoOptions([]);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const debounceSearch = _.debounce((text: string) => {
|
|
||||||
handleOnSearchRepo(text);
|
|
||||||
}, 300);
|
|
||||||
|
|
||||||
const renderHuggingfaceFields = () => {
|
const renderHuggingfaceFields = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -258,157 +239,33 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleWorkerLabelsChange = useCallback(
|
|
||||||
(labels: Record<string, any>) => {
|
|
||||||
console.log('labels========', labels);
|
|
||||||
form.setFieldValue('worker_selector', labels);
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleOnSelectModel = useCallback((item: any) => {
|
|
||||||
const repo = item.name;
|
|
||||||
if (form.getFieldValue('source') === modelSourceMap.huggingface_value) {
|
|
||||||
form.setFieldValue('huggingface_repo_id', repo);
|
|
||||||
handleFetchModelFiles(repo);
|
|
||||||
} else {
|
|
||||||
form.setFieldValue('ollama_library_model_name', repo);
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleSourceChange = useCallback((value: string) => {
|
|
||||||
form.setFieldValue('source', value);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleSumit = () => {
|
const handleSumit = () => {
|
||||||
form.submit();
|
form.submit();
|
||||||
};
|
};
|
||||||
|
|
||||||
const collapseItems = [
|
const handleOk = (formdata: FormData) => {
|
||||||
{
|
const gpu = _.find(gpuOptions, (item: any) => {
|
||||||
key: '1',
|
return item.value === formdata.gpu_selector;
|
||||||
label: (
|
});
|
||||||
<span style={{ fontWeight: 'var(--font-weight-medium)' }}>
|
if (gpu) {
|
||||||
{intl.formatMessage({ id: 'resources.form.advanced' })}
|
onOk({
|
||||||
</span>
|
..._.omit(formdata, ['scheduleType']),
|
||||||
),
|
gpu_selector: {
|
||||||
children: (
|
gpu_name: gpu.name,
|
||||||
<>
|
gpu_index: gpu.index,
|
||||||
<Form.Item<FormData> name="placement_strategy">
|
worker_name: gpu.worker_name
|
||||||
<SealSelect
|
|
||||||
label={intl.formatMessage({
|
|
||||||
id: 'resources.form.placementStrategy'
|
|
||||||
})}
|
|
||||||
options={placementStrategyOptions}
|
|
||||||
description={
|
|
||||||
<div>
|
|
||||||
<div className="m-b-8">
|
|
||||||
<Typography.Title
|
|
||||||
level={5}
|
|
||||||
style={{
|
|
||||||
color: 'var(--color-white-1)',
|
|
||||||
marginRight: 10
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Spread:
|
|
||||||
</Typography.Title>
|
|
||||||
<Typography.Text style={{ color: 'var(--color-white-1)' }}>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: 'resources.form.spread.tips'
|
|
||||||
})}
|
|
||||||
</Typography.Text>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<Typography.Title
|
|
||||||
level={5}
|
|
||||||
style={{ color: 'var(--color-white-1)', marginRight: 10 }}
|
|
||||||
>
|
|
||||||
Binpack:
|
|
||||||
</Typography.Title>
|
|
||||||
<Typography.Text style={{ color: 'var(--color-white-1)' }}>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: 'resources.form.binpack.tips'
|
|
||||||
})}
|
|
||||||
</Typography.Text>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
></SealSelect>
|
});
|
||||||
</Form.Item>
|
} else {
|
||||||
<div style={{ marginBottom: 24 }}>
|
onOk({
|
||||||
<FormItemWrapper noWrapperStyle>
|
..._.omit(formdata, ['scheduleType'])
|
||||||
<Form.Item<FormData>
|
});
|
||||||
name="partial_offload"
|
|
||||||
valuePropName="checked"
|
|
||||||
style={{ padding: '0 10px', marginBottom: 0 }}
|
|
||||||
>
|
|
||||||
<Checkbox>
|
|
||||||
<Tooltip
|
|
||||||
title={intl.formatMessage({
|
|
||||||
id: 'models.form.partialoffload.tips'
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<span style={{ color: 'var(--ant-color-text-tertiary)' }}>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: 'resources.form.enablePartialOffload'
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
<InfoCircleOutlined
|
|
||||||
className="m-l-4"
|
|
||||||
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
</Checkbox>
|
|
||||||
</Form.Item>
|
|
||||||
</FormItemWrapper>
|
|
||||||
</div>
|
|
||||||
<div style={{ marginBottom: 24 }}>
|
|
||||||
<FormItemWrapper noWrapperStyle>
|
|
||||||
<Form.Item<FormData>
|
|
||||||
name="distributed_inference_across_workers"
|
|
||||||
valuePropName="checked"
|
|
||||||
style={{ padding: '0 10px', marginBottom: 0 }}
|
|
||||||
>
|
|
||||||
<Checkbox>
|
|
||||||
<Tooltip
|
|
||||||
title={intl.formatMessage({
|
|
||||||
id: 'models.form.distribution.tips'
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<span style={{ color: 'var(--ant-color-text-tertiary)' }}>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: 'resources.form.enableDistributedInferenceAcrossWorkers'
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
<InfoCircleOutlined
|
|
||||||
className="m-l-4"
|
|
||||||
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
</Checkbox>
|
|
||||||
</Form.Item>
|
|
||||||
</FormItemWrapper>
|
|
||||||
</div>
|
|
||||||
<Form.Item<FormData> name="worker_selector">
|
|
||||||
<LabelSelector
|
|
||||||
label={intl.formatMessage({
|
|
||||||
id: 'resources.form.workerSelector'
|
|
||||||
})}
|
|
||||||
labels={form.getFieldValue('worker_selector')}
|
|
||||||
onChange={handleWorkerLabelsChange}
|
|
||||||
description={
|
|
||||||
<span>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: 'resources.form.workerSelector.description'
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
}
|
}
|
||||||
></LabelSelector>
|
};
|
||||||
</Form.Item>
|
|
||||||
</>
|
useEffect(() => {
|
||||||
)
|
getGPUList();
|
||||||
}
|
}, []);
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
@@ -449,7 +306,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
<Form
|
<Form
|
||||||
name="addModalForm"
|
name="addModalForm"
|
||||||
form={form}
|
form={form}
|
||||||
onFinish={onOk}
|
onFinish={handleOk}
|
||||||
preserve={false}
|
preserve={false}
|
||||||
style={{
|
style={{
|
||||||
padding: 'var(--ant-modal-content-padding)',
|
padding: 'var(--ant-modal-content-padding)',
|
||||||
@@ -535,19 +392,8 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
})}
|
})}
|
||||||
></SealInput.TextArea>
|
></SealInput.TextArea>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Collapse
|
|
||||||
expandIconPosition="start"
|
<AdvanceConfig form={form} gpuOptions={gpuOptions}></AdvanceConfig>
|
||||||
bordered={false}
|
|
||||||
ghost
|
|
||||||
className={dataformStyles['advanced-collapse']}
|
|
||||||
expandIcon={({ isActive }) => (
|
|
||||||
<RightOutlined
|
|
||||||
rotate={isActive ? 90 : 0}
|
|
||||||
style={{ fontSize: '12px' }}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
items={collapseItems}
|
|
||||||
></Collapse>
|
|
||||||
</Form>
|
</Form>
|
||||||
</SimpleBar>
|
</SimpleBar>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -13,6 +13,12 @@ export interface ListItem {
|
|||||||
id: number;
|
id: number;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
updated_at: string;
|
updated_at: string;
|
||||||
|
gpu_selector?: {
|
||||||
|
worker_name: string;
|
||||||
|
gpu_index: number;
|
||||||
|
gpu_name: string;
|
||||||
|
};
|
||||||
|
worker_selector?: object;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FormData {
|
export interface FormData {
|
||||||
@@ -22,6 +28,11 @@ export interface FormData {
|
|||||||
s3_address: string;
|
s3_address: string;
|
||||||
ollama_library_model_name: 'string';
|
ollama_library_model_name: 'string';
|
||||||
distributed_inference_across_workers?: boolean;
|
distributed_inference_across_workers?: boolean;
|
||||||
|
gpu_selector?: {
|
||||||
|
worker_name: string;
|
||||||
|
gpu_index: number;
|
||||||
|
gpu_name: string;
|
||||||
|
};
|
||||||
placement_strategy?: string;
|
placement_strategy?: string;
|
||||||
partial_offload?: boolean;
|
partial_offload?: boolean;
|
||||||
worker_selector?: object;
|
worker_selector?: object;
|
||||||
@@ -61,3 +72,26 @@ export interface ModelInstanceFormData {
|
|||||||
huggingface_repo_id: 'string';
|
huggingface_repo_id: 'string';
|
||||||
huggingface_filename: 'string';
|
huggingface_filename: 'string';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GPUListItem {
|
||||||
|
name: string;
|
||||||
|
uuid: string;
|
||||||
|
vendor: string;
|
||||||
|
index: number;
|
||||||
|
core: {
|
||||||
|
total: number;
|
||||||
|
utilization_rate: number;
|
||||||
|
};
|
||||||
|
memory: {
|
||||||
|
total: number;
|
||||||
|
utilization_rate: number;
|
||||||
|
is_unified_memory: boolean;
|
||||||
|
used: number;
|
||||||
|
allocated: number;
|
||||||
|
};
|
||||||
|
temperature: number;
|
||||||
|
id: string;
|
||||||
|
worker_id: number;
|
||||||
|
worker_name: string;
|
||||||
|
worker_ip: string;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user