ONE - On-device Neural Engine
Loading...
Searching...
No Matches
profile.py
Go to the documentation of this file.
1
# Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
6
#
7
# http://www.apache.org/licenses/LICENSE-2.0
8
#
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
15
# Command schema for one-profile when BACKEND={BACKEND_NAME}.
16
#
17
# Install path (required by ONE):
18
# /usr/share/one/backends/command/{BACKEND_NAME}/profile.py
19
#
20
# Example onecc snippet:
21
# [one-profile]
22
# backend={BACKEND_NAME}
23
# input_path=model.opt.circle
24
# report_path=report.json
25
# warmup=5
26
# repeat=50
27
28
from
onelib
import
argumentparse
29
from
onelib.argumentparse
import
DriverName, NormalOption, TargetOption
30
31
32
def
command_schema
():
33
parser =
argumentparse.ArgumentParser
()
34
35
# Backend driver for profiling
36
parser.add_argument(
"{BACKEND_NAME}-profile"
, action=DriverName)
37
38
# Target propagation (same as in codegen)
39
parser.add_argument(
"--target"
, action=TargetOption)
40
41
# Common profiling knobs
42
parser.add_argument(
"input"
,
"input_path"
, action=NormalOption)
43
parser.add_argument(
"--report"
,
"--report_path"
, action=NormalOption)
44
parser.add_argument(
"--warmup"
, action=NormalOption, dtype=int)
45
parser.add_argument(
"--repeat"
, action=NormalOption, dtype=int)
46
47
# Optional: hardware execution switches
48
# parser.add_argument("--device", action=NormalOption, dtype=int)
49
# parser.add_argument("--dump-timeline", action=NormalOption, dtype=bool)
50
51
return
parser
argumentparse.ArgumentParser
Definition
argumentparse.py:118
profile.command_schema
command_schema()
Definition
profile.py:32
compiler
one-global-conf-template
backend
BACKEND_NAME
one-cmds
profile.py
Generated by
1.9.8