-
Notifications
You must be signed in to change notification settings - Fork 38
[IREE] Inference & Benchmark #590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[IREE] Inference & Benchmark #590
Conversation
85d30e8 to
8cf3fbf
Compare
valentina-kustikova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Vladislav-Denisov, посмотрела код, написала небольшие комментарии. Надо еще отследить, что проверка стиля кодирования везде проходит.
src/inference/inference_iree.py
Outdated
|
|
||
| def load_iree_model(vmfb_buffer): | ||
| try: | ||
| config = ireert.Config('local-task') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'local-task' - единственное возможное значение параметра функции? Не понятно, имеет ли смысл выносить в константы или параметры.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Все доступные варианты помимо local-task описаны в табличке здесь
Я захардкодил, потому что пока что рассматривал только запуск на CPU.
4192375 to
40cfd33
Compare
40cfd33 to
15ac8f9
Compare
valentina-kustikova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Vladislav-Denisov, информацию о поддержке IREE надо добавить в основной README в корне репозитория. Также упали тесты с paddlepaddle, поправьте, пожалуйста, версию библиотеки.
src/inference/iree_auxiliary.py
Outdated
| exp_logits = np.exp(logits - max_logits) | ||
| probabilities = exp_logits / np.sum(exp_logits, axis=-1, keepdims=True) | ||
|
|
||
| return {output_key: probabilities} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Думаю, что это должно быть оформлен в отдельном классе, который является наследником IOAdapter или наследником адаптера для задачи классификации.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я реализовал prepare_output именно как отдельный вспомогательный метод, применяя подход аналогичный любому другому фреймворку , который требует подготовки выхода перед его передачей в
dl-benchmark/src/inference/io_adapter.py
Line 246 in ec4106e
| def process_output(self, result, log): |
Например:
- PyTorch
def prepare_output(result, output_names, task_type): - NCNN
def prepare_output(results, task, model_wrapper): - MXNET
def prepare_output(result, output_names, task, model_wrapper): - TensorFlow
def prepare_output(result, outputs_name, task): - и т.д.
Думаю, что если переделывать это на некоторый класс, который будет как-то связан с IOAdapter, то это стоит делать везде и это займет относительно много времени для аккуратного решения.
Пока что просто упростил prepare_output для IREE, избавился от лишнего.
No description provided.