Skip to main content

produce NPU instructions

Project description

# NPU compiler

produce NPU instructions

## Release Notes

### Release 1.6.2
  • FORNAX支持CPU计算算子,支持LayerNorm, Softmax, LogSoftmax, RMSNorm

  • FORNAX模型内存优化。

  • FORNAX模型支持state 8bit存储,使用配置项STATE_8BIT,默认false

  • FORNAX PyTorch 支持EXCLUDE_COMPRESS_WEIGHT_OPS配置项,支持指定部分卷积不压缩。

  • PyTorch 模型用户可指定生成.h文件中输入输出名称。

  • 增加配置项MODEL_ENCRYPTED,支持输入加密模型文件。

  • BUG修复。

### Release 1.6.1
  • 支持FORNAX模型编译。

  • APUS模型优化,支持卷积核3x3。

  • GRUS模型优化。

  • BUG修复。

### Release 1.6.0
  • GRUS和APUS支持PyTorch模型编译。

  • APUS编译优化。

  • APUS增加配置项MAX_CACHE_SIZE,用于配置用户可开辟的cache大小。

  • APUS增加配置项USE_DATA_CACHE,用于决定是否需要将临时内存的数据拷贝到CACHE中再计算。

  • APUS增加配置项SPLIT_CMD,用于决定是否需要拆碎指令。

  • BUG修复。

### Release 1.5.11
  • GRUS支持Transpose HWC转WHC

  • GRUS临时内存优化。

  • BUG修复。

### Release 1.5.10
  • GRUS取消全连接权重必须小于65536的限制。

  • GRUS支持DepthwiseConv2d SAME模式。

  • GRUS编译时-v参数可打印出权重个数和flops数。

### Release 1.5.9
  • 增加APUS芯片。

  • BUG修复。

### Release 1.5.8
  • LEO增加AddV2

  • GRUS增加配置项FUSE_BIASADD,配置MatMul和BiasAdd,Conv2D和BiasAdd是否融合,默认为False

### Release 1.5.7
  • GRUS增加配置项WEIGHT_MIN_MAX,可指定权重量化的最小最大值。

  • BUG修复。

### Release 1.5.6
  • 编译时不使用GPU.

  • GRUS支持多个OP使用同一个权重。

  • GRUS支持MatMul的第2个参数是变量而非权重。

  • GRUS芯片增加Mean,SquaredDifference,Abs,FusedBatchNormV2,FusedBatchNormV3.

  • GRUS芯片增加配置项EXCLUDE_CONV2D_COMPRESS_OPS用于指定某个卷积权重不压缩。

  • GRUS芯片增加配置项EXCLUDE_COMPRESS_OPS用于指定某个卷积或全连接权重不压缩。

  • GRUS芯片增加`-s`选项用于保存权重的数据分布直方图。

  • GRUS芯片优化Conv2D在kernel_width和stride_width相等时的存储和算力。

### Release 1.5.5
  • GRUS芯片修复StridedSlice end小于begin时出现的错误。

### Release 1.5.4
  • LEO芯片增加CONV2D_COMPRESS配置项,用于配置Conv2D权重是否量化压缩。

  • GRUS芯片增加Slice,Shape OP.

  • GRUS芯片支持shape为[N,M]和[N,1]做Add,AddV2,Sub,Mul,Div的情况。

  • BUG修复。

### Release 1.5.2
  • GRUS芯片不再支持Maximum和Minimum.

  • GRUS芯片生成的.h文件中增加in_out结构体。

  • GRUS芯片增加AddV2,BatchMatMulV2,FusedBatchNorm.

  • GRUS芯片优化量化方法,减少量化损失。

  • GRUS芯片配置文件增加配置项FUSE_BN,可配置是否把BN参数合并到卷积中,默认不合并。

  • BUG修复。

### Release 1.5.1
  • GRUS芯片卷积权重默认不压缩,如需压缩,配置文件中指定CONV2D_COMPRESS: true

  • 增加Python版本的判断,目前支持Python2.7和Python3.6,不是这些版本则报错。

  • 解决Python3安装包在conda环境下安装后,报”undefined symbol: PyFPE_jbuf”的问题。

  • GRUS芯片增加Pad OP

  • GRUS芯片支持MaxPool和AvgPool的kernel_h或kernel_w为1的情况。

  • GRUS芯片模型编译后增加NPU Size的打印信息。

  • GRUS芯片优化depthwise_conv2d的内存。

### Release 1.5.0
  • 增加GRUS芯片的支持。

### Release 1.0.17
  • 优化Transpose,MatMul的计算。

  • BUG修复。

### Release 1.0.16
  • 配置文件中增加MODEL_INFO字段,可加入用户自定义的模型信息,编译完后该信息和编译时间会加入到npu文件中。

  • 优化了Conv2d和DepthwiseConv2d NCHW 1*1卷积核的计算。

  • 支持空洞卷积(tf.layers.Conv2D中dilation大于1)。

  • BUG修复。

### Release 1.0.15
  • 增加OP:Relu6, GatherV2

  • 支持SNPU的ReverseV2 OP

  • 合并DepthwiseConv2d和Add/BiasAdd运算,优化BiasAdd,提高Rsqrt的精度,优化prelu

  • 整合了tensorflow的inference优化脚本,如果模型中的FusedBatchNorm OP前是Conv2D或DepthwiseConv2d,FusedBatchNorm会优化成BiasAdd

  • gxnpuc增加-m选项,编译模式时加上该选项可以打印出各个OP的内存信息。

  • BUG修复。

### Release 1.0.14
  • 增加OP: ListDiff,Abs

  • 支持Tile运行时计算

  • 优化Concat,Reduce类OP(如Sum, Mean)的计算,节省BatchMatMul的内存空间

  • 支持命令行读取配置参数,如 cat config.yaml | gxnpuc

  • Bug修复。

### Release 1.0.13
  • 支持Select OP

  • 加快生成c_code模型的速度。

  • 优化SNPU的1*1卷积,转置,减少生成指令大小。

  • 增加MEAN_SHRINK_OPS配置项,容易溢出的Mean OP放在该列表中,NPU会先做除法再做加法。

  • 生成的模型中增加需要内存总大小:total_size字段。

  • BUG修复。

### Release 1.0.12
  • 支持新版本TensorFlow的模型有些OP在其输入OP后面的情况。

  • 优化1*1的卷积,能减少大量指令,提高执行效率。

  • 优化Transpose OP

  • 增加模型中间数据的复用,减少模型需要的内存。

  • BUG修复。

### Release 1.0.11
  • 增加了DepthwiseConv2dNative,AvgPool, Conv2DBackpropInput, Maximum, Minimum, GreaterEqual, LessEqual, Assert, Tile, All, Any, BatchMatMul, ReverseV2, Exp

  • 支持做MatMul时,权重(第二个输入数据)在编译阶段不确定的情况。

  • BUG修复。

### Release 1.0.10
  • 对Conv2D, Slice等OP的优化。

  • 增加了Max, Min, FloorDiv, FloorMod OP

  • 增加了空间优化的选项,可以根据模型时间敏感还是空间敏感来配置。配置项为 SPACE_OPTIMIZATION:0/1 数字越大表示需要内存空间越小,相应速度会慢,目前只支持0或1。目前只有Conv2D, Slice OP在某些条件下会起作用。

  • BUG修复。

### Release 1.0.9
  • 针对NPU硬件的问题增加了补丁。

  • 优化了Mean, Sum, Conv2D等OP

  • 增加对1x1卷积核的支持。

  • BUG修复。

### Release 1.0.8 (空缺)

### Release 1.0.7
  • 配置文件中可以任意指定输出OP,不执行和输出OP无关的OP

  • 增加LogSoftmax OP

  • OP优化和BUG修复

### Release 1.0.6
  • 配置文件增加新配置项 CORENAME,可以选择 LEO 或 LEO_MPE,默认为 LEO

  • 对OP log 和 softmax 合并在一起计算,减少计算误差。

  • 加速多 batch LSTM计算,加速归一化计算。

  • 参数 fp32 转 fp16 由截位变成四舍五入。

  • bug 修复。

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

npu_compiler-1.6.5-cp38-cp38-manylinux1_x86_64.whl (20.2 MB view details)

Uploaded CPython 3.8

npu_compiler-1.6.5-cp37-cp37m-manylinux_2_5_x86_64.whl (103.9 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ x86-64

npu_compiler-1.6.5-cp36-cp36m-manylinux_2_5_x86_64.whl (65.8 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.5+ x86-64

File details

Details for the file npu_compiler-1.6.5-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: npu_compiler-1.6.5-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 20.2 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10

File hashes

Hashes for npu_compiler-1.6.5-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9558765f233498c5730fe241f41acfd1b8bc8efd857a69c34d8495e87cce5236
MD5 e1335e51c3cc5e47532975405b16c6ce
BLAKE2b-256 368af04fd8a04cb972a96decb9367e2b5b47f1042006d99028f60068fd3b74e3

See more details on using hashes here.

File details

Details for the file npu_compiler-1.6.5-cp37-cp37m-manylinux_2_5_x86_64.whl.

File metadata

  • Download URL: npu_compiler-1.6.5-cp37-cp37m-manylinux_2_5_x86_64.whl
  • Upload date:
  • Size: 103.9 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10

File hashes

Hashes for npu_compiler-1.6.5-cp37-cp37m-manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 b189c0f0885dad2c47186586df34df9a0beea5f82539cd04edce2183c4b11225
MD5 fd91e183c9b8ed435f99a945b7d55a3c
BLAKE2b-256 ee7b42f0d0320b4522f1acc50ad3429a0ab8886855eae3c9ec9f8b22d4901c6a

See more details on using hashes here.

File details

Details for the file npu_compiler-1.6.5-cp36-cp36m-manylinux_2_5_x86_64.whl.

File metadata

  • Download URL: npu_compiler-1.6.5-cp36-cp36m-manylinux_2_5_x86_64.whl
  • Upload date:
  • Size: 65.8 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10

File hashes

Hashes for npu_compiler-1.6.5-cp36-cp36m-manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 d1f41184ff23ee7f4afd0feb45060046d44fdb4006d8df2bcba43ae5aa4b39c3
MD5 d2e174d23257b225315467ec9c425646
BLAKE2b-256 0ba6e6422cdff7e326e54f48c88d079ced404585611dbbbc3b0edf87a6b979a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page