From da985871ccc396f986eff4f875789ca6a799178d Mon Sep 17 00:00:00 2001 From: jialin Date: Fri, 6 Feb 2026 12:16:36 +0800 Subject: [PATCH] fix: benchmark issues --- src/locales/en-US/playground.ts | 3 +- src/locales/ja-JP/playground.ts | 3 +- src/locales/ru-RU/playground.ts | 3 +- .../components/add-benchmark-modal.tsx | 6 + .../benchmark/components/summary/basic.tsx | 245 ------------------ .../components/summary/benchmark.tsx | 10 +- .../benchmark/components/summary/instance.tsx | 80 +++--- .../components/summary/percentile-result.tsx | 2 +- src/pages/benchmark/config/detail-context.ts | 1 + src/pages/benchmark/config/detail-types.ts | 2 +- src/pages/benchmark/config/form-context.ts | 2 + src/pages/benchmark/config/index.ts | 2 +- src/pages/benchmark/details.tsx | 13 +- src/pages/benchmark/forms/basic.tsx | 6 +- src/pages/benchmark/forms/dataset.tsx | 46 ++-- src/pages/benchmark/forms/index.tsx | 16 +- src/pages/benchmark/forms/random-settings.tsx | 109 ++++---- .../benchmark/hooks/use-column-settings.tsx | 51 +--- src/pages/benchmark/index.tsx | 15 +- .../benchmark/services/use-query-profiles.ts | 1 + 20 files changed, 197 insertions(+), 419 deletions(-) delete mode 100644 src/pages/benchmark/components/summary/basic.tsx diff --git a/src/locales/en-US/playground.ts b/src/locales/en-US/playground.ts index 28929cd1..31fd04bf 100644 --- a/src/locales/en-US/playground.ts +++ b/src/locales/en-US/playground.ts @@ -171,6 +171,7 @@ export default { 'playground.params.refAudio': 'Reference Audio', 'playground.params.refAudio.tips': 'Enter a reference audio URL, or upload an audio file.', - 'playground.params.refAudio.text': 'Transcript of Reference Audio (no ICL)', + 'playground.params.refAudio.text': + 'Transcript of Reference Audio (for ICL mode)', 'playground.params.refAudio.vectorMode': 'Use Speaker Embedding Only (no ICL)' }; diff --git a/src/locales/ja-JP/playground.ts b/src/locales/ja-JP/playground.ts index 1f7ac03d..e31d1d07 100644 --- a/src/locales/ja-JP/playground.ts +++ b/src/locales/ja-JP/playground.ts @@ -174,7 +174,8 @@ export default { 'playground.params.refAudio': 'Reference Audio', 'playground.params.refAudio.tips': 'Enter a reference audio URL, or upload an audio file.', - 'playground.params.refAudio.text': 'Transcript of Reference Audio (no ICL)', + 'playground.params.refAudio.text': + 'Transcript of Reference Audio (for ICL mode)', 'playground.params.refAudio.vectorMode': 'Use Speaker Embedding Only (no ICL)' }; diff --git a/src/locales/ru-RU/playground.ts b/src/locales/ru-RU/playground.ts index f3a1fc3c..6200fd44 100644 --- a/src/locales/ru-RU/playground.ts +++ b/src/locales/ru-RU/playground.ts @@ -168,7 +168,8 @@ export default { 'playground.params.refAudio': 'Reference Audio', 'playground.params.refAudio.tips': 'Enter a reference audio URL, or upload an audio file.', - 'playground.params.refAudio.text': 'Transcript of Reference Audio (no ICL)', + 'playground.params.refAudio.text': + 'Transcript of Reference Audio (for ICL mode)', 'playground.params.refAudio.vectorMode': 'Use Speaker Embedding Only (no ICL)' }; diff --git a/src/pages/benchmark/components/add-benchmark-modal.tsx b/src/pages/benchmark/components/add-benchmark-modal.tsx index 1be91976..e46f4ec3 100644 --- a/src/pages/benchmark/components/add-benchmark-modal.tsx +++ b/src/pages/benchmark/components/add-benchmark-modal.tsx @@ -11,6 +11,8 @@ type AddModalProps = { open: boolean; currentData?: ListItem; // Used when action is EDIT clusterList?: Global.BaseOption[]; + profilesOptions?: Global.BaseOption[]; + datasetList?: Global.BaseOption[]; onOk: (values: FormData) => void; onCancel: () => void; }; @@ -20,6 +22,8 @@ const AddBenchmark: React.FC = ({ open, currentData, clusterList, + profilesOptions, + datasetList, onOk, onCancel }) => { @@ -54,6 +58,8 @@ const AddBenchmark: React.FC = ({ open={open} currentData={currentData} clusterList={clusterList} + profilesOptions={profilesOptions} + datasetList={datasetList} onFinish={handleOk} /> diff --git a/src/pages/benchmark/components/summary/basic.tsx b/src/pages/benchmark/components/summary/basic.tsx deleted file mode 100644 index aa339316..00000000 --- a/src/pages/benchmark/components/summary/basic.tsx +++ /dev/null @@ -1,245 +0,0 @@ -import AutoTooltip from '@/components/auto-tooltip'; -import { useIntl } from '@umijs/max'; -import { Col, Descriptions, DescriptionsProps, Row, Statistic } from 'antd'; -import dayjs from 'dayjs'; -import _, { round } from 'lodash'; -import React from 'react'; -import styled from 'styled-components'; -import { useDetailContext } from '../../config/detail-context'; -import Section from './section'; - -const Container = styled.div` - display: flex; - flex-direction: column; - gap: 16px; -`; - -const Card = styled.div` - height: 78px; - padding: 12px 16px; - border: 1px solid var(--ant-color-border); - border-radius: var(--ant-border-radius); - background-color: var(--ant-color-bg-container); -`; - -const Box = styled.div` - display: grid; - grid-template-columns: 1fr 1fr; - gap: 16px; -`; - -const Summary: React.FC = () => { - const { detailData, clusterList } = useDetailContext(); - const intl = useIntl(); - const rawMetrics = _.get(detailData, ['raw_metrics', 'benchmarks', '0'], {}); - - const items: DescriptionsProps['items'] = [ - { - key: '1', - label: 'Model', - children: {detailData.model_name} - }, - { - key: '2', - label: 'Cluster', - children: ( - - {clusterList?.find((item) => item.value === detailData.cluster_id) - ?.label || detailData.cluster_id} - - ) - }, - { - key: '4', - label: 'Dataset', - children: detailData.dataset_name - }, - { - key: '5', - label: 'Duration (s)', - children: round(rawMetrics.duration || 0, 2) - }, - { - key: '3', - label: 'Update Time', - children: dayjs(detailData.updated_at).format('YYYY-MM-DD HH:mm:ss') - } - ]; - const cardFields = [ - { - label: 'Total Requests', - key: 'total_requests', - value: detailData.total_requests, - precision: 0, - unit: '' - }, - { - label: 'Success Rate', - key: 'success_rate', - value: round( - (_.get(rawMetrics, 'metrics.request_totals.successful') / - _.get(rawMetrics, 'metrics.request_totals.total')) * - 100 || 0, - 1 - ), - color: 'var(--ant-color-success)', - precision: 0, - unit: '%' - }, - { - label: 'Incomplete Count', - key: 'incomplete_count', - value: _.get(rawMetrics, 'metrics.request_totals.incomplete'), - color: 'var(--ant-color-warning)', - unit: '' - }, - // { - // label: 'Error Count', - // key: 'error_count', - // value: _.get(rawMetrics, 'metrics.request_totals.error'), - // color: 'var(--ant-color-error)', - // unit: '' - // }, - { - label: 'Concurrency', - key: 'concurrency', - value: _.get(rawMetrics, 'metrics.request_concurrency.successful.mean'), - precision: 2, - unit: '' - }, - { - label: 'RPS', - key: 'rps', - value: detailData.requests_per_second_mean, - precision: 2, - unit: 'req/s' - }, - { - label: 'ITL', - key: 'itl', - value: detailData.inter_token_latency_mean, - unit: 'ms' - }, - { - label: 'TPOT', - key: 'time_per_output_token_mean', - value: detailData.time_per_output_token_mean, - precision: 2, - unit: 'ms' - }, - { - label: 'TTFT', - key: 'time_to_first_token_mean', - value: detailData.time_to_first_token_mean, - precision: 2, - unit: 'ms' - } - ]; - - const throughputFields = [ - { - key: '3', - label: 'Total token throughput', - children: `${round(detailData.tokens_per_second_mean || 0, 2)} Tokens/s` - }, - { - key: '1', - label: 'Request token throughput', - children: `${round(detailData.input_tokens_per_second_mean || 0, 2)} Tokens/s` - }, - { - key: '2', - label: 'Output token throughput', - children: `${round(detailData.output_tokens_per_second_mean || 0, 2)} Tokens/s` - } - ]; - - const latencyFields = [ - { - key: '1', - label: 'Avg Request Latency', - children: `${round(detailData.request_latency_mean, 2)} ms` - }, - { - key: '2', - label: 'Avg Time to First Token', - children: `${round(detailData.time_to_first_token_mean, 2)} ms` - }, - { - key: '3', - label: 'Avg Time Per Output Token', - children: `${round(detailData.time_per_output_token_mean, 2)} ms` - } - ]; - - return ( - - - {cardFields.map((field) => ( - - - - - - ))} - -
- -
- - -
- -
-
- -
-
-
- ); -}; - -export default Summary; diff --git a/src/pages/benchmark/components/summary/benchmark.tsx b/src/pages/benchmark/components/summary/benchmark.tsx index 6d75a15e..0f4c8300 100644 --- a/src/pages/benchmark/components/summary/benchmark.tsx +++ b/src/pages/benchmark/components/summary/benchmark.tsx @@ -5,13 +5,17 @@ import { useDetailContext } from '../../config/detail-context'; const Benchmark: React.FC = () => { const intl = useIntl(); - const { detailData } = useDetailContext(); + const { detailData, profilesOptions } = useDetailContext(); const items: DescriptionsProps['items'] = [ { key: '1', label: intl.formatMessage({ id: 'benchmark.form.profile' }), - children: detailData?.profile || '-' + children: + profilesOptions.find((option) => option.value === detailData?.profile) + ?.label || + detailData?.profile || + '-' }, { key: '2', @@ -43,7 +47,7 @@ const Benchmark: React.FC = () => { { key: '5', label: intl.formatMessage({ id: 'playground.image.params.seed' }), - children: detailData?.seed || '-' + children: detailData?.dataset_seed || '-' } ]; diff --git a/src/pages/benchmark/components/summary/instance.tsx b/src/pages/benchmark/components/summary/instance.tsx index bd4dc705..7062c6b7 100644 --- a/src/pages/benchmark/components/summary/instance.tsx +++ b/src/pages/benchmark/components/summary/instance.tsx @@ -59,25 +59,29 @@ const Instance: React.FC = () => { { key: '1', label: intl.formatMessage({ id: 'models.form.backend_parameters' }), - children: ( - - {instanceData?.backend_parameters?.map( - (param: string, index: number) => ( - - {param} - - ) - )} - - ) + children: + instanceData?.backend_parameters && + instanceData?.backend_parameters.length > 0 ? ( + + {instanceData?.backend_parameters?.map( + (param: string, index: number) => ( + + {param} + + ) + )} + + ) : ( + '-' + ) }, { key: '3', @@ -86,24 +90,32 @@ const Instance: React.FC = () => { {instanceData?.extended_kv_cache?.enabled ? ( <> - - - {intl.formatMessage({ id: 'models.form.ramRatio' })}: + {instanceData?.extended_kv_cache?.ram_ratio && ( + + + {intl.formatMessage({ id: 'models.form.ramRatio' })}: + + {instanceData?.extended_kv_cache?.ram_ratio} - {instanceData?.extended_kv_cache?.ram_ratio} - - - - {intl.formatMessage({ id: 'models.form.ramSize' })}: + )} + + {instanceData?.extended_kv_cache?.ram_size && ( + + + {intl.formatMessage({ id: 'models.form.ramSize' })}: + + {instanceData?.extended_kv_cache?.ram_size} - {instanceData?.extended_kv_cache?.ram_size} - - - - {intl.formatMessage({ id: 'models.form.chunkSize' })}: + )} + + {instanceData?.extended_kv_cache?.chunk_size && ( + + + {intl.formatMessage({ id: 'models.form.chunkSize' })}: + + {instanceData?.extended_kv_cache?.chunk_size} - {instanceData?.extended_kv_cache?.chunk_size} - + )} ) : ( '-' diff --git a/src/pages/benchmark/components/summary/percentile-result.tsx b/src/pages/benchmark/components/summary/percentile-result.tsx index 7d0bda6a..a6c34a9c 100644 --- a/src/pages/benchmark/components/summary/percentile-result.tsx +++ b/src/pages/benchmark/components/summary/percentile-result.tsx @@ -32,7 +32,7 @@ const PercentileResult: React.FC = () => { render: (value: number) => round(value, 2) }, { - title: `${intl.formatMessage({ id: 'benchmark.detail.percentile.latency' })} (s)`, + title: `${intl.formatMessage({ id: 'benchmark.detail.percentile.latency' })} (ms)`, dataIndex: 'request_latency', render: (value: number) => round(value, 2) }, diff --git a/src/pages/benchmark/config/detail-context.ts b/src/pages/benchmark/config/detail-context.ts index 546bc3f9..8584ea8e 100644 --- a/src/pages/benchmark/config/detail-context.ts +++ b/src/pages/benchmark/config/detail-context.ts @@ -6,6 +6,7 @@ interface DetailContextProps { clusterList?: Global.BaseOption[]; id: number; loading?: boolean; + profilesOptions: Global.BaseOption[]; } const DetailContext = createContext( diff --git a/src/pages/benchmark/config/detail-types.ts b/src/pages/benchmark/config/detail-types.ts index ac93ea19..fd5f335c 100644 --- a/src/pages/benchmark/config/detail-types.ts +++ b/src/pages/benchmark/config/detail-types.ts @@ -66,7 +66,7 @@ export interface GPUData { export interface BenchmarkDetail { profile: string; - seed: number; + dataset_seed: number; raw_metrics: { benchmarks: Array<{ metrics: Record; diff --git a/src/pages/benchmark/config/form-context.ts b/src/pages/benchmark/config/form-context.ts index c3b3e3ff..60f6e161 100644 --- a/src/pages/benchmark/config/form-context.ts +++ b/src/pages/benchmark/config/form-context.ts @@ -6,6 +6,8 @@ interface FormContextProps { open?: boolean; clusterList?: Global.BaseOption[]; modelList?: Global.BaseOption[]; + profilesOptions: Global.BaseOption[]; + datasetList: Global.BaseOption[]; } const FormContext = createContext({} as FormContextProps); diff --git a/src/pages/benchmark/config/index.ts b/src/pages/benchmark/config/index.ts index 7a627d3e..21eb5f8e 100644 --- a/src/pages/benchmark/config/index.ts +++ b/src/pages/benchmark/config/index.ts @@ -74,7 +74,7 @@ export const profileOptions = [ } ]; -const DatasetValueMap = { +export const DatasetValueMap = { ShareGPT: 'ShareGPT', Random: 'Random' }; diff --git a/src/pages/benchmark/details.tsx b/src/pages/benchmark/details.tsx index 9de251e6..f5d95be7 100644 --- a/src/pages/benchmark/details.tsx +++ b/src/pages/benchmark/details.tsx @@ -16,6 +16,7 @@ import useViewLogs from './hooks/use-view-logs'; import { useExportBenchmark } from './services/use-export-benchmark'; import useQueryBenchmarkList from './services/use-query-benchmarks'; import useQueryDetail from './services/use-query-detail'; +import useQueryProfiles from './services/use-query-profiles'; import useStopBenchmark from './services/use-stop-benchmark'; const Details: React.FC = () => { @@ -27,6 +28,11 @@ const Details: React.FC = () => { fetchData: fetchBenchmarkList, cancelRequest: cancelBenchmarkRequest } = useQueryBenchmarkList(); + const { + profilesOptions, + fetchProfilesData, + cancelRequest: cancelProfilesRequest + } = useQueryProfiles(); const { loading, detailData, cancelRequest, fetchData } = useQueryDetail(); const { openViewLogsModal, closeViewLogsModal, openViewLogsModalStatus } = useViewLogs(); @@ -92,7 +98,7 @@ const Details: React.FC = () => { } else if (val === 'stop') { handleStopBenchmark(row.id); } else if (val === 'export') { - exportData([row.id]); + exportData([row.id], row.name); } }); @@ -102,8 +108,10 @@ const Details: React.FC = () => { useEffect(() => { fetchBenchmarkList({ page: -1 }); + fetchProfilesData(); return () => { cancelBenchmarkRequest(); + cancelProfilesRequest(); }; }, []); @@ -126,7 +134,8 @@ const Details: React.FC = () => { detailData: detailData || {}, clusterList: [], loading: loading, - id: Number(id) + id: Number(id), + profilesOptions: profilesOptions }} > { { required: true, message: getRuleMessage('input', 'common.table.name') + }, + { + pattern: modelNameReg, + message: intl.formatMessage({ id: 'models.form.rules.name' }) } ]} > diff --git a/src/pages/benchmark/forms/dataset.tsx b/src/pages/benchmark/forms/dataset.tsx index 8d1b366c..5d2b74b6 100644 --- a/src/pages/benchmark/forms/dataset.tsx +++ b/src/pages/benchmark/forms/dataset.tsx @@ -9,26 +9,13 @@ import React, { useEffect } from 'react'; import { ProfileValueMap } from '../config'; import { useFormContext } from '../config/form-context'; import { FormData } from '../config/types'; -import useQueryDataset from '../services/use-query-dataset'; -import useQueryProfiles from '../services/use-query-profiles'; import RandomSettingsForm from './random-settings'; const DatasetForm: React.FC = () => { const intl = useIntl(); const form = Form.useFormInstance(); const { getRuleMessage } = useAppUtils(); - const { action, open } = useFormContext(); - const { - datasetList, - loading: datasetLoading, - fetchDatasetData, - cancelRequest: cancelDatasetRequest - } = useQueryDataset(); - const { - profilesOptions, - fetchProfilesData, - cancelRequest: cancelProfilesRequest - } = useQueryProfiles(); + const { action, open, profilesOptions, datasetList } = useFormContext(); const handleProfileChange = (value: string, option: any) => { if (value !== ProfileValueMap.Custom) { @@ -43,6 +30,8 @@ const DatasetForm: React.FC = () => { } }; + const labelRender = (label: string) => {}; + // Initialize profile when open form const initProfile = ( value: string, @@ -63,28 +52,28 @@ const DatasetForm: React.FC = () => { }; useEffect(() => { - if (!open) { - cancelDatasetRequest(); - cancelProfilesRequest(); - } - if (open) { const init = async () => { - const profiles = await fetchProfilesData(); - const datasets = await fetchDatasetData(); - // set default profile - if (profiles?.length > 0) { - const throughputProfile = profiles.find( + if ( + profilesOptions && + profilesOptions.length > 0 && + action === PageAction.CREATE + ) { + const throughputProfile = profilesOptions.find( (item) => item.value === ProfileValueMap.ThroughputMedium ); if (throughputProfile) { - initProfile(throughputProfile.value, throughputProfile, datasets); + initProfile( + throughputProfile.value, + throughputProfile, + datasetList + ); } } }; init(); } - }, [open]); + }, [open, action, profilesOptions, datasetList]); return ( <> @@ -127,10 +116,7 @@ const DatasetForm: React.FC = () => { - + ); }; diff --git a/src/pages/benchmark/forms/index.tsx b/src/pages/benchmark/forms/index.tsx index 46ed0292..2e373374 100644 --- a/src/pages/benchmark/forms/index.tsx +++ b/src/pages/benchmark/forms/index.tsx @@ -24,6 +24,8 @@ interface ProviderFormProps { currentData?: ListItem; // Used when action is EDIT open?: boolean; clusterList?: Global.BaseOption[]; + datasetList: Global.BaseOption[]; + profilesOptions: Global.BaseOption[]; onFinish: (values: FormData) => Promise; } @@ -34,7 +36,15 @@ const TABKeysMap = { }; const ProviderForm: React.FC = forwardRef((props, ref) => { - const { action, currentData, onFinish, open, clusterList } = props; + const { + action, + currentData, + onFinish, + open, + clusterList, + profilesOptions, + datasetList + } = props; const intl = useIntl(); const [form] = Form.useForm(); const { getScrollElementScrollableHeight } = useWrapperContext(); @@ -102,7 +112,9 @@ const ProviderForm: React.FC = forwardRef((props, ref) => { value={{ action, open, - clusterList: clusterList + clusterList: clusterList, + profilesOptions: profilesOptions, + datasetList: datasetList }} >
[]; - datasetLoading: boolean; }> = (props) => { - const { datasetList, datasetLoading } = props; + const { datasetList } = props; const intl = useIntl(); const { action, open } = useFormContext(); const form = Form.useFormInstance(); const profile = Form.useWatch('profile', form); + const datasetName = Form.useWatch('dataset_name', form); const { getRuleMessage } = useAppUtils(); const disabled = useMemo(() => { @@ -43,58 +44,66 @@ const RandomSettingsForm: React.FC<{ label: item.label, value: item.label }))} - loading={datasetLoading} label={intl.formatMessage({ id: 'benchmark.table.dataset' })} required > - - name="dataset_input_tokens" - rules={[ - { - required: true, - message: getRuleMessage('input', 'benchmark.table.inputTokenLength') - } - ]} - > - - - - name="dataset_output_tokens" - rules={[ - { - required: true, - message: getRuleMessage( - 'input', - 'benchmark.table.outputTokenLength' - ) - } - ]} - > - - - - name="dataset_seed" - getValueProps={(value) => ({ value: value || null })} - > - - + {datasetName === DatasetValueMap.Random && ( + <> + + name="dataset_input_tokens" + rules={[ + { + required: true, + message: getRuleMessage( + 'input', + 'benchmark.table.inputTokenLength' + ) + } + ]} + > + + + + name="dataset_output_tokens" + rules={[ + { + required: true, + message: getRuleMessage( + 'input', + 'benchmark.table.outputTokenLength' + ) + } + ]} + > + + + + name="dataset_seed" + getValueProps={(value) => ({ value: value || null })} + > + + + + )} name="request_rate" getValueProps={(value) => ({ value: value < 0 ? 'Infinity' : value })} diff --git a/src/pages/benchmark/hooks/use-column-settings.tsx b/src/pages/benchmark/hooks/use-column-settings.tsx index a96fe227..16670039 100644 --- a/src/pages/benchmark/hooks/use-column-settings.tsx +++ b/src/pages/benchmark/hooks/use-column-settings.tsx @@ -92,10 +92,11 @@ const BenchmarkStateTag = (props: { data: ListItem }) => { const useColumnSettings = (options: { contentHeight: number; + profileOptions: Global.BaseOption[]; clusterList: Global.BaseOption[]; }) => { const intl = useIntl(); - const { contentHeight, clusterList } = options; + const { contentHeight, clusterList, profileOptions } = options; const [selectedColumns, setSelectedColumns] = React.useState(defaultColumns); @@ -111,10 +112,10 @@ const useColumnSettings = (options: { title={`${title} ${options?.subTitle || ''}`} > {title} + {options?.subTitle && ( +
{options.subTitle}
+ )} - {options?.subTitle && ( - {options.subTitle} - )} ); }; @@ -247,45 +248,6 @@ const useColumnSettings = (options: { ), unit: '' - }, - { - title: renderTitle( - intl.formatMessage({ id: 'benchmark.detail.requests.success' }) - ), - dataIndex: 'successful_requests', - path: ['raw_metrics', 'benchmarks', '0'], - render: (value: number) => - round(_.get(value, ['metrics', 'request_totals', 'successful']), 0) || - 0, - precision: 0, - color: 'var(--ant-color-success)', - unit: '' - }, - { - title: renderTitle( - intl.formatMessage({ id: 'benchmark.detail.requests.failed' }) - ), - dataIndex: 'failed_requests', - path: ['raw_metrics', 'benchmarks', '0'], - render: (value: number) => - round(_.get(value, ['metrics', 'request_totals', 'errored']), 0) || 0, - precision: 0, - color: 'var(--ant-color-error)', - unit: '' - }, - { - title: renderTitle( - intl.formatMessage({ - id: 'benchmark.detail.requests.concurrency' - }) - ), - dataIndex: 'request_concurrency', - path: ['raw_metrics', 'benchmarks', '0'], - render: (value: number) => - round(_.get(value, 'metrics.request_concurrency.successful.mean'), 0) || - 0, - precision: 0, - unit: '' } ]; @@ -326,7 +288,8 @@ const useColumnSettings = (options: { dataIndex: 'profile', render: (text: string) => ( - {text} + {profileOptions.find((option) => option.value === text)?.label || + text} ) }, diff --git a/src/pages/benchmark/index.tsx b/src/pages/benchmark/index.tsx index b88ea1ef..df63ba54 100644 --- a/src/pages/benchmark/index.tsx +++ b/src/pages/benchmark/index.tsx @@ -32,6 +32,7 @@ import useCreateBenchmark from './hooks/use-create-benchmark'; import useViewLogs from './hooks/use-view-logs'; import { useExportBenchmark } from './services/use-export-benchmark'; import useQueryDataset from './services/use-query-dataset'; +import useQueryProfiles from './services/use-query-profiles'; import useStopBenchmark from './services/use-stop-benchmark'; const Benchmark: React.FC = () => { @@ -73,15 +74,22 @@ const Benchmark: React.FC = () => { cancelRequest: cancelClusterRequest, clusterList } = useQueryClusterList(); + const { benchmarkTargetInstance } = useBenchmarkTargetInstance(); + const { + profilesOptions, + fetchProfilesData, + cancelRequest: cancelProfilesRequest + } = useQueryProfiles(); const { SettingsButton, columns: selectedColumns } = useColumnSettings({ contentHeight: 320, - clusterList + clusterList, + profileOptions: profilesOptions }); - const { benchmarkTargetInstance } = useBenchmarkTargetInstance(); useEffect(() => { fetchModelList({ page: -1 }); fetchDatasetData(); + fetchProfilesData(); fetchClusterList({ page: -1 }).then(() => { if (benchmarkTargetInstance.model_name) { openBenchmarkModal( @@ -92,6 +100,7 @@ const Benchmark: React.FC = () => { }); return () => { cancelClusterRequest(); + cancelProfilesRequest(); }; }, []); @@ -261,6 +270,8 @@ const Benchmark: React.FC = () => { action={openBenchmarkModalStatus.action} title={openBenchmarkModalStatus.title} currentData={openBenchmarkModalStatus.currentData} + profilesOptions={profilesOptions} + datasetList={datasetList} onCancel={handleModalCancel} onOk={handleModalOk} > diff --git a/src/pages/benchmark/services/use-query-profiles.ts b/src/pages/benchmark/services/use-query-profiles.ts index fa4ad160..462f3678 100644 --- a/src/pages/benchmark/services/use-query-profiles.ts +++ b/src/pages/benchmark/services/use-query-profiles.ts @@ -56,6 +56,7 @@ export default function useQueryProfiles() { } } ]; + console.log('options===', options); setProfilesOptions(options); return options; };