Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • Paddle
  • Issue
  • #14612

P
Paddle
  • 项目概览

PaddlePaddle / Paddle
大约 2 年 前同步成功

通知 2325
Star 20933
Fork 5424
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 1423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
Paddle
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 1,423
    • Issue 1,423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
    • 合并请求 543
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 11月 27, 2018 by saxon_zh@saxon_zhGuest

[Need to discuss]: Add more flexibility to pass for MKLDNN kernel

Created by: bingyanghuang

For now, if we want to enable one or several ops' mkldnn kernel not all the ops who have mkldnn kernel support in C-API model, the way we use now is to add the specific pass to enable these kinds of ops. However, this way has poor scalability, we need add different passes for different models. So, we'd like to propose whether

  1. we could add some parameters when we add the new pass , i.e. we can create a general pass named enable_specific_mkldnn with parameters "graph" and a "list" containing the op names that the user want to enable their mkldnn kernel. When the user wants to enable one or two specific mkldnn ops, he can add this pass in his model with specific ops' names.
  2. or let the pass function know the predictor configures informations This is simpler way by following exist architecture. We can pass a list of op type names with predictor config, if pass mode is to enable specific mkldnn op kernel, the pass will read this list and change these specific ops' attribute "use_mkldnn" to "true".

以防我英文没有说清楚,再用中文说一遍。 现在我们遇到了一个问题就是,无法在model的C-API端单独使能某几个op的mkldnn kernel, 因为一旦设置mkldnn的全局变量,就会使能所有支持mkldnn kernel op。基于现有框架可以实现的是,增加pass去使能我们所需要使能mkldnn的op,这就意味着对于每一个不同的model和不同的情况下我们都要创建不同的pass, 这样一来,可扩展性和可维护性就很差。我们初步讨论后,提出两种方案希望可以与你们在周三的例会上讨论一下。

  1. 在创建pass的时候可以传入更多的参数。现有的pass实现下,传入给pass的参数为Graph,是否考虑再传入一个数组,这个数组里面包含了我希望更改的op的名字,这个数组的传入是可以由用户端定义和传入的。这样,在执行这个pass的时候就可以根据这个传入的数组进行特定的图修改;
  2. 用现有的config这个属性传入一个数组,在pass的函数中可以读取predictor的config这个属性。现在我们在创建predictor的时候,用户可以通过config来传入一些他所需要的设置,我们是否可以也通过config传入一个我们需要更改的op名字的数组,然后在pass函数中可以读取到这个config的信息来单独设置某几个op的“use_mkldnn”为true。

This is a general description for mkldnn enabling in C-API, for more details, we'd like to discuss with Baidu in our weekly meeting.

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/Paddle#14612
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7