maccel.model.Model Class Reference#
|
SDK qb Runtime Library v0.28
MCS001-EN
|
maccel.model.Model Class Reference
Public Member Functions | |
| __init__ (self, str path, Optional[ModelConfig] model_config=None) | |
| None | launch (self, Accelerator acc) |
| None | dispose (self) |
| bool | is_target (self, CoreId core_id) |
| CoreMode | get_core_mode (self) |
| List[CoreId] | get_target_cores (self) |
| List[CoreId] | target_cores (self) |
| Optional[List[np.ndarray]] | infer (self, Union[np.ndarray, List[np.ndarray]] inputs, Optional[List[np.ndarray]] outputs=None, int cache_size=0) |
| List[np.ndarray] | infer_to_float (self, Union[np.ndarray, List[np.ndarray],] inputs, int cache_size=0) |
| None | infer_buffer (self, List[Buffer] inputs, List[Buffer] outputs, List[List[int]] shape=[], int cache_size=0) |
| None | infer_speedrun (self) |
| Future | infer_async (self, Union[np.ndarray, List[np.ndarray]] inputs) |
| None | reposition_inputs (self, List[np.ndarray] inputs, List[Buffer] input_bufs, List[List[int]] seqlens=[]) |
| None | reposition_outputs (self, List[Buffer] output_bufs, List[np.ndarray] outputs, List[List[int]] seqlens=[]) |
| List[_Shape] | get_model_input_shape (self) |
| List[_Shape] | get_model_output_shape (self) |
| List[Scale] | get_input_scale (self) |
| List[Scale] | get_output_scale (self) |
| List[BufferInfo] | get_input_buffer_info (self) |
| List[BufferInfo] | get_output_buffer_info (self) |
| List[Buffer] | acquire_input_buffer (self, List[List[int]] seqlens=[]) |
| List[Buffer] | acquire_output_buffer (self, List[List[int]] seqlens=[]) |
| None | release_buffer (self, List[Buffer] buffer) |
| int | get_identifier (self) |
| str | get_model_path (self) |
| SchedulePolicy | get_schedule_policy (self) |
| LatencySetPolicy | get_latency_set_policy (self) |
| MaintenancePolicy | get_maintenance_policy (self) |
| int | get_latency_consumed (self) |
| int | get_latency_finished (self) |
| None | reset_cache_memory (self) |
| bytes | dump_cache_memory (self) |
| None | load_cache_memory (self, bytes buf) |
| None | dump_cache_memory_to (self, str cache_path) |
| None | load_cache_memory_from (self, str cache_path) |
| int | filter_cache_tail (self, int cache_size, int tail_size, List[bool] mask) |
| int | move_cache_tail (self, int num_head, int num_tail, int cache_size) |
Static Public Attributes | |
| Optional[List[np.ndarray]] | infer_chw = infer |
| List[np.ndarray] | infer_chw_to_float = infer_to_float |
Protected Attributes | |
| _model = _cMaccel.Model(path) | |
| List[_Shape] | _input_shape = self.get_model_input_shape() |
| List[_Shape] | _output_shape = self.get_model_output_shape() |
| _acc = acc | |
Detailed Description
Constructor & Destructor Documentation
◆ __init__()
| maccel.model.Model.__init__ | ( | self, | |
| str | path, | ||
| Optional[ModelConfig] | model_config = None ) |
Member Function Documentation
◆ launch()
| None maccel.model.Model.launch | ( | self, | |
| Accelerator | acc ) |
◆ dispose()
◆ is_target()
◆ get_core_mode()
◆ get_target_cores()
◆ target_cores()
◆ infer()
| Optional[List[np.ndarray]] maccel.model.Model.infer | ( | self, | |
| Union[np.ndarray, List[np.ndarray]] | inputs, | ||
| Optional[List[np.ndarray]] | outputs = None, | ||
| int | cache_size = 0 ) |
◆ infer_to_float()
| List[np.ndarray] maccel.model.Model.infer_to_float | ( | self, | |
| Union[ np.ndarray, List[np.ndarray], ] | inputs, | ||
| int | cache_size = 0 ) |
◆ infer_buffer()
◆ infer_speedrun()
◆ infer_async()
| Future maccel.model.Model.infer_async | ( | self, | |
| Union[np.ndarray, List[np.ndarray]] | inputs ) |
◆ reposition_inputs()
| None maccel.model.Model.reposition_inputs | ( | self, | |
| List[np.ndarray] | inputs, | ||
| List[Buffer] | input_bufs, | ||
| List[List[int]] | seqlens = [] ) |
◆ reposition_outputs()
| None maccel.model.Model.reposition_outputs | ( | self, | |
| List[Buffer] | output_bufs, | ||
| List[np.ndarray] | outputs, | ||
| List[List[int]] | seqlens = [] ) |
◆ get_model_input_shape()
| List[_Shape] maccel.model.Model.get_model_input_shape | ( | self | ) |
◆ get_model_output_shape()
| List[_Shape] maccel.model.Model.get_model_output_shape | ( | self | ) |
◆ get_input_scale()
◆ get_output_scale()
◆ get_input_buffer_info()
| List[BufferInfo] maccel.model.Model.get_input_buffer_info | ( | self | ) |
◆ get_output_buffer_info()
| List[BufferInfo] maccel.model.Model.get_output_buffer_info | ( | self | ) |
◆ acquire_input_buffer()
| List[Buffer] maccel.model.Model.acquire_input_buffer | ( | self, | |
| List[List[int]] | seqlens = [] ) |
◆ acquire_output_buffer()
| List[Buffer] maccel.model.Model.acquire_output_buffer | ( | self, | |
| List[List[int]] | seqlens = [] ) |
◆ release_buffer()
| None maccel.model.Model.release_buffer | ( | self, | |
| List[Buffer] | buffer ) |
◆ get_identifier()
◆ get_model_path()
◆ get_schedule_policy()
| SchedulePolicy maccel.model.Model.get_schedule_policy | ( | self | ) |
◆ get_latency_set_policy()
| LatencySetPolicy maccel.model.Model.get_latency_set_policy | ( | self | ) |
◆ get_maintenance_policy()
| MaintenancePolicy maccel.model.Model.get_maintenance_policy | ( | self | ) |
◆ get_latency_consumed()
◆ get_latency_finished()
◆ reset_cache_memory()
◆ dump_cache_memory()
◆ load_cache_memory()
| None maccel.model.Model.load_cache_memory | ( | self, | |
| bytes | buf ) |
◆ dump_cache_memory_to()
| None maccel.model.Model.dump_cache_memory_to | ( | self, | |
| str | cache_path ) |
◆ load_cache_memory_from()
| None maccel.model.Model.load_cache_memory_from | ( | self, | |
| str | cache_path ) |
◆ filter_cache_tail()
| int maccel.model.Model.filter_cache_tail | ( | self, | |
| int | cache_size, | ||
| int | tail_size, | ||
| List[bool] | mask ) |
◆ move_cache_tail()
| int maccel.model.Model.move_cache_tail | ( | self, | |
| int | num_head, | ||
| int | num_tail, | ||
| int | cache_size ) |
Member Data Documentation
◆ infer_chw
|
static |
◆ infer_chw_to_float
|
static |
◆ _model
◆ _input_shape
|
protected |
◆ _output_shape
|
protected |
◆ _acc
The documentation for this class was generated from the following file:
Generated by