Skip to content

Commit 08ab978

Browse files
committed
remove unused codes
1 parent 90b0021 commit 08ab978

File tree

6 files changed

+0
-57
lines changed

6 files changed

+0
-57
lines changed

js/web/lib/wasm/binding/ort-wasm.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ export interface OrtWasmModule extends EmscriptenModule {
180180
jsepCreateDownloader:
181181
(gpuBuffer: GPUBuffer, size: number,
182182
type: Tensor.GpuBufferDataTypes) => () => Promise<Tensor.DataTypeMap[Tensor.GpuBufferDataTypes]>;
183-
jsepRunStart: (sessionId: number) => void;
184-
jsepRunEnd: (sessionId: number) => void;
185183
// #endregion
186184
}
187185

js/web/lib/wasm/jsep/backend-webgpu.ts

-29
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ export class WebGpuBackend {
129129
return data;
130130
}
131131

132-
// required min regular runs before graph capture for the necessary memory allocations.
133-
// const int min_num_runs_before_webgpu_graph_capture_ = 1
134-
135132
/**
136133
* a KernelID -> kernel info mapping. value is
137134
* [ op_type, name, run function, [optional] preprocess_attribute_once function ]
@@ -528,32 +525,6 @@ export class WebGpuBackend {
528525
}
529526
// #endregion
530527

531-
runStart(sessionId: number): void {
532-
LOG_DEBUG('info', () => `runStart sessionId: ${sessionId}`);
533-
/*
534-
// Begin webgpu graph capture.
535-
if (webgpu_graph_enable_ && IsGraphCaptureAllowed() && !IsGraphCaptured()) {
536-
LOG_DEBUG('info', () => 'Capturing the webgpu graph for this model');
537-
CaptureBegin();
538-
}
539-
*/
540-
}
541-
runEnd(sessionId: number): void {
542-
LOG_DEBUG('info', () => `runEnd sessionId: ${sessionId}`);
543-
// End webgpu graph capture.
544-
/*
545-
if (webgpu_graph_enable_ && !IsGraphCaptured()) {
546-
if (IsGraphCaptureAllowed()) {
547-
CaptureEnd();
548-
// CUDA work issued to a capturing stream doesn’t actually run on the GPU,
549-
// so run the captured graph here to actually execute the work.
550-
ReplayGraph();
551-
} else {
552-
IncrementRegularRunCountBeforeGraphCapture();
553-
}
554-
}
555-
*/
556-
}
557528
captureBegin(): void {
558529
LOG_DEBUG('info', () => 'captureBegin');
559530
this.capturedCommandList = [];

js/web/lib/wasm/wasm-core-impl.ts

-2
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ export const run = async(
406406
const outputNamesOffset = wasm.stackAlloc(outputCount * 4);
407407

408408
try {
409-
wasm.jsepRunStart(sessionId);
410409
[runOptionsHandle, runOptionsAllocs] = setRunOptions(options);
411410

412411
// create input tensors
@@ -582,7 +581,6 @@ export const run = async(
582581
if (ioBindingState) {
583582
wasm._OrtClearBoundOutputs(ioBindingState.handle);
584583
}
585-
wasm.jsepRunEnd(sessionId);
586584
return output;
587585
} finally {
588586
wasm.stackRestore(beforeRunStack);

onnxruntime/core/providers/js/js_execution_provider.cc

-14
Original file line numberDiff line numberDiff line change
@@ -790,20 +790,6 @@ bool JsExecutionProvider::IsGraphCaptureAllowed() const {
790790
}
791791

792792
void JsExecutionProvider::IncrementRegularRunCountBeforeGraphCapture() {
793-
// Please note that this function is not thread safe.
794-
// ORT TRT calls this function in compute_func() where synchronization is enforced due to lock_guard(),
795-
// therefore following increment is guaranteed to be thread safe.
796793
++regular_run_count_before_graph_capture_;
797794
}
798-
/*
799-
void JsExecutionProvider::CaptureBegin() {
800-
cuda_graph_.Reset();
801-
cuda_graph_.CaptureBegin();
802-
}
803-
804-
void JsExecutionProvider::CaptureEnd() {
805-
cuda_graph_.CaptureEnd();
806-
is_graph_captured_ = true;
807-
}
808-
*/
809795
} // namespace onnxruntime

onnxruntime/core/providers/js/js_execution_provider.h

-4
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ class JsExecutionProvider : public IExecutionProvider {
7171
DataLayout preferred_data_layout_;
7272
bool is_graph_captured_ = false;
7373
int regular_run_count_before_graph_capture_ = 0;
74-
// There is chance (currently only happens in CUDA EP) that the second regular run allocates GPU memory for causes like:
75-
// (1) memory pattern is enabled. (2) arena allocation for stream.
76-
// Since no GPU memory allocation is allowed during graph capturing, we need at least two regular runs
77-
// to allocate enough memory in Arena before graph capturing.
7874
const int min_num_runs_before_cuda_graph_capture_ = 1; // required min regular runs before graph capture for the necessary memory allocations.
7975
};
8076

onnxruntime/wasm/js_internal_api.js

-6
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,4 @@ Module['jsepInit'] = (backend, alloc, free, copy, copyAsync, createKernel, relea
169169
Module['jsepCreateDownloader'] = (gpuBuffer, size, type) => {
170170
return backend['createDownloader'](gpuBuffer, size, type);
171171
};
172-
Module['jsepRunStart'] = (sessionId) => {
173-
return backend['runStart'](sessionId);
174-
};
175-
Module['jsepRunEnd'] = (sessionId) => {
176-
return backend['runEnd'](sessionId);
177-
};
178172
};

0 commit comments

Comments
 (0)