Skip to content
Merged

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const injectedRtkApi = api
query: (queryArg) => ({
url: `/tests/performance`,
method: "POST",
body: queryArg.performanceTestSpecInput,
body: queryArg.performanceTestSpec,
}),
invalidatesTags: ["tests"],
}),
Expand All @@ -235,7 +235,7 @@ const injectedRtkApi = api
query: (queryArg) => ({
url: `/tests/density`,
method: "POST",
body: queryArg.densityTestSpecInput,
body: queryArg.densityTestSpec,
}),
invalidatesTags: ["tests"],
}),
Expand Down Expand Up @@ -365,12 +365,12 @@ export type OptimizePipelineApiArg = {
export type RunPerformanceTestApiResponse =
/** status 202 Performance test job created */ TestJobResponse;
export type RunPerformanceTestApiArg = {
performanceTestSpecInput: PerformanceTestSpec2;
performanceTestSpec: PerformanceTestSpec;
};
export type RunDensityTestApiResponse =
/** status 202 Density test job created */ TestJobResponse;
export type RunDensityTestApiArg = {
densityTestSpecInput: DensityTestSpec2;
densityTestSpec: DensityTestSpec;
};
export type GetVideosApiResponse =
/** status 200 Successful Response */ Video[];
Expand Down Expand Up @@ -439,17 +439,9 @@ export type PerformanceJobStatus = {
} | null;
error_message: string | null;
};
export type EncoderDeviceConfig = {
/** Name of the encoder device (e.g., 'GPU', 'CPU', 'NPU') */
device_name?: string;
/** GPU device index (only applicable when device_name indicates a GPU) */
gpu_id?: number | null;
};
export type VideoOutputConfig = {
/** Flag to enable or disable video output generation. */
enabled?: boolean;
/** Encoder device configuration (only applicable when video output is enabled). */
encoder_device?: EncoderDeviceConfig;
};
export type PerformanceTestSpec = {
/** List of pipelines with number of streams for each. */
Expand Down Expand Up @@ -607,20 +599,6 @@ export type TestJobResponse = {
/** Identifier of the created test job. */
job_id: string;
};
export type PerformanceTestSpec2 = {
/** List of pipelines with number of streams for each. */
pipeline_performance_specs: PipelinePerformanceSpec[];
/** Video output configuration. */
video_output?: VideoOutputConfig;
};
export type DensityTestSpec2 = {
/** Minimum acceptable FPS per stream. */
fps_floor: number;
/** List of pipelines with relative stream_rate percentages that must sum to 100. */
pipeline_density_specs: PipelineDensitySpec[];
/** Video output configuration. */
video_output?: VideoOutputConfig;
};
export type Video = {
filename: string;
width: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
const SaveOutputWarning = () => {
return (
<div className="text-muted-foreground dark:text-foreground/80 border border-amber-400 my-2 p-2 bg-amber-200/50 w-1/2">
<b>Note 1</b>: The current implementation does not automatically infer the
best encoding device from the existing pipeline. Select the same device
that is already used by other blocks in your pipeline. To learn more,
refer to our documentation:{" "}
<a
href="https://docs.openedgeplatform.intel.com/2025.2/edge-ai-libraries/visual-pipeline-and-platform-evaluation-tool/index.html"
target="_blank"
rel="noopener noreferrer"
className="hover:text-classic-blue transition-colors underline"
>
link
</a>
.
<br />
<b>Note 2</b>: Selecting this option will negatively impact the
performance results.
<b>Note</b>: Selecting this option will negatively impact the performance
results.
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { PipelineStreamsSummary } from "@/features/pipeline-tests/PipelineStream
import { PipelineName } from "@/features/pipelines/PipelineName.tsx";
import { useAppSelector } from "@/store/hooks";
import { selectPipelines } from "@/store/reducers/pipelines";
import { selectDevices } from "@/store/reducers/devices";
import { Checkbox } from "@/components/ui/checkbox";
import {
Tooltip,
Expand All @@ -18,7 +17,6 @@ import {
} from "@/components/ui/tooltip";
import { Plus, X } from "lucide-react";
import { ParticipationSlider } from "@/features/pipeline-tests/ParticipationSlider.tsx";
import DeviceSelect from "@/components/shared/DeviceSelect";
import SaveOutputWarning from "@/features/pipeline-tests/SaveOutputWarning.tsx";

interface PipelineSelection {
Expand All @@ -30,7 +28,6 @@ interface PipelineSelection {

const DensityTests = () => {
const pipelines = useAppSelector(selectPipelines);
const devices = useAppSelector(selectDevices);
const [runDensityTest, { isLoading: isRunning }] =
useRunDensityTestMutation();
const [pipelineSelections, setPipelineSelections] = useState<
Expand All @@ -46,7 +43,6 @@ const DensityTests = () => {
} | null>(null);
const [videoOutputEnabled, setVideoOutputEnabled] = useState(false);
const [errorMessage, setErrorMessage] = useState<string | null>(null);
const [encoderDevice, setEncoderDevice] = useState<string>("CPU");

const { data: jobStatus } = useGetDensityJobStatusQuery(
{ jobId: jobId! },
Expand Down Expand Up @@ -154,24 +150,10 @@ const DensityTests = () => {
setTestResult(null);
setErrorMessage(null);
try {
const selectedDevice = devices.find(
(d) => d.device_name === encoderDevice,
);

const result = await runDensityTest({
densityTestSpecInput: {
densityTestSpec: {
video_output: {
enabled: videoOutputEnabled,
encoder_device:
videoOutputEnabled && selectedDevice
? {
device_name: selectedDevice.device_name,
gpu_id:
selectedDevice.device_family === "GPU"
? (selectedDevice.gpu_id ?? 0)
: undefined,
}
: undefined,
},
fps_floor: fpsFloor,
pipeline_density_specs: pipelineSelections.map((selection) => ({
Expand Down Expand Up @@ -319,16 +301,6 @@ const DensityTests = () => {
</TooltipContent>
</Tooltip>
</div>
{videoOutputEnabled && (
<div>
<span>Select device for encoding: </span>
<DeviceSelect
value={encoderDevice}
onChange={setEncoderDevice}
className="w-fit px-3 py-2 border text-sm cursor-pointer bg-background"
/>
</div>
)}
{videoOutputEnabled && <SaveOutputWarning />}
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { TestProgressIndicator } from "@/features/pipeline-tests/TestProgressInd
import { PipelineName } from "@/features/pipelines/PipelineName.tsx";
import { useAppSelector } from "@/store/hooks";
import { selectPipelines } from "@/store/reducers/pipelines";
import { selectDevices } from "@/store/reducers/devices";
import { Checkbox } from "@/components/ui/checkbox";
import {
Tooltip,
Expand All @@ -16,7 +15,6 @@ import {
} from "@/components/ui/tooltip";
import { Plus, X } from "lucide-react";
import { StreamsSlider } from "@/features/pipeline-tests/StreamsSlider.tsx";
import DeviceSelect from "@/components/shared/DeviceSelect";
import SaveOutputWarning from "@/features/pipeline-tests/SaveOutputWarning.tsx";

interface PipelineSelection {
Expand All @@ -28,7 +26,6 @@ interface PipelineSelection {

const PerformanceTests = () => {
const pipelines = useAppSelector(selectPipelines);
const devices = useAppSelector(selectDevices);
const [runPerformanceTest, { isLoading: isRunning }] =
useRunPerformanceTestMutation();
const [pipelineSelections, setPipelineSelections] = useState<
Expand All @@ -44,7 +41,6 @@ const PerformanceTests = () => {
} | null>(null);
const [videoOutputEnabled, setVideoOutputEnabled] = useState(false);
const [errorMessage, setErrorMessage] = useState<string | null>(null);
const [encoderDevice, setEncoderDevice] = useState<string>("CPU");

const { data: jobStatus } = useGetPerformanceJobStatusQuery(
{ jobId: jobId! },
Expand Down Expand Up @@ -149,24 +145,10 @@ const PerformanceTests = () => {
setTestResult(null);
setErrorMessage(null);
try {
const selectedDevice = devices.find(
(d) => d.device_name === encoderDevice,
);

const result = await runPerformanceTest({
performanceTestSpecInput: {
performanceTestSpec: {
video_output: {
enabled: videoOutputEnabled,
encoder_device:
videoOutputEnabled && selectedDevice
? {
device_name: selectedDevice.device_name,
gpu_id:
selectedDevice.device_family === "GPU"
? (selectedDevice.gpu_id ?? 0)
: undefined,
}
: undefined,
},
pipeline_performance_specs: pipelineSelections.map((selection) => ({
id: selection.pipelineId,
Expand Down Expand Up @@ -297,16 +279,6 @@ const PerformanceTests = () => {
</TooltipContent>
</Tooltip>
</div>
{videoOutputEnabled && (
<div>
<span>Select device for encoding: </span>
<DeviceSelect
value={encoderDevice}
onChange={setEncoderDevice}
className="w-fit px-3 py-2 border text-sm cursor-pointer bg-background"
/>
</div>
)}
{videoOutputEnabled && <SaveOutputWarning />}
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import StopPerformanceTestButton from "@/features/pipeline-editor/StopPerformanc
import ExportPipelineButton from "@/features/pipeline-editor/ExportPipelineButton.tsx";
import DeletePipelineButton from "@/features/pipeline-editor/DeletePipelineButton.tsx";
import ImportPipelineButton from "@/features/pipeline-editor/ImportPipelineButton.tsx";
import DeviceSelect from "@/components/shared/DeviceSelect";
import { Zap } from "lucide-react";
import { isApiError } from "@/lib/apiUtils";
import {
Expand All @@ -33,16 +32,13 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { Checkbox } from "@/components/ui/checkbox";
import { useAppSelector } from "@/store/hooks";
import { selectDevices } from "@/store/reducers/devices";

type UrlParams = {
id: string;
};

const Pipelines = () => {
const { id } = useParams<UrlParams>();
const devices = useAppSelector(selectDevices);
const [performanceTestJobId, setPerformanceTestJobId] = useState<
string | null
>(null);
Expand All @@ -56,7 +52,6 @@ const Pipelines = () => {
const [editorKey, setEditorKey] = useState(0);
const [shouldFitView, setShouldFitView] = useState(false);
const [videoOutputEnabled, setVideoOutputEnabled] = useState(true);
const [encoderDevice, setEncoderDevice] = useState<string>("CPU");
const [completedVideoPath, setCompletedVideoPath] = useState<string | null>(
null,
);
Expand Down Expand Up @@ -396,24 +391,10 @@ const Pipelines = () => {
},
}).unwrap();

const selectedDevice = devices.find(
(d) => d.device_name === encoderDevice,
);

const response = await runPerformanceTest({
performanceTestSpecInput: {
performanceTestSpec: {
video_output: {
enabled: videoOutputEnabled,
encoder_device:
videoOutputEnabled && selectedDevice
? {
device_name: selectedDevice.device_name,
gpu_id:
selectedDevice.device_family === "GPU"
? (selectedDevice.gpu_id ?? 0)
: undefined,
}
: undefined,
},
pipeline_performance_specs: [
{
Expand Down Expand Up @@ -617,31 +598,7 @@ const Pipelines = () => {
</p>
</TooltipContent>
</Tooltip>
{videoOutputEnabled && (
<DeviceSelect
value={encoderDevice}
onChange={setEncoderDevice}
className="bg-background p-2 text-sm font-medium cursor-pointer border-none outline-none"
/>
)}
</div>
{videoOutputEnabled && (
<div className="text-muted-foreground dark:text-foreground/80 border border-amber-400 my-2 p-2 bg-amber-200/50 w-[634px]">
<b>Note</b>: The current implementation does not automatically
infer the best encoding device from the existing pipeline. Select
the same device that is already used by other blocks in your
pipeline. To learn more, refer to our documentation:{" "}
<a
href="https://docs.openedgeplatform.intel.com/2025.2/edge-ai-libraries/visual-pipeline-and-platform-evaluation-tool/index.html"
target="_blank"
rel="noopener noreferrer"
className="hover:text-classic-blue transition-colors underline"
>
link
</a>
.
</div>
)}
</div>
</div>
);
Expand Down
Loading
Loading