Commit Graph
201 Commits
Author SHA1 Message Date
nihui bd5842174f pnnx reshape improve compatibility with old ncnn (#6806)
* onnx flatten to reshape
2026-07-06 19:23:00 +08:00
nihui 81e8cbffd0 pnnx ci update torch 2.12 (#6796) 2026-07-03 23:46:56 +08:00
nihui b10a8327fb pnnx ncnn legalize global pooling layout (#6795) 2026-07-03 16:21:59 +08:00
nihui 127b414614 reshape support batch to/from dim (#6784) 2026-07-02 19:29:34 +08:00
nihui 706c4d1964 support 4d mat in more operators (#6737)
Add 4d Mat handling across generic and optimized backends, extend operator tests, and document supported input and output Mat dimensions.
2026-05-22 15:31:01 +08:00
Luneandnihui bedf9c6568 unaryop: extend sign, hyperbolic, expm1 and log1p support (#6675)
Add backend support for new UnaryOp operations across scalar, SIMD and Vulkan paths, including sign, sinh, cosh, asinh, acosh, atanh, expm1 and log1p.

Wire the new ops through onnx2ncnn and pnnx expression conversion, update generated Python emission, and add regression coverage for the new conversion paths.

Fix portability issues for expm1/log1p math declarations, NCNN_SIMPLEMATH builds, ONNX-enabled pnnx linking, and stabilize unary op tests across fp16, bf16 and torch exporter/version differences.

Co-authored-by: nihui <nihuini@tencent.com>
2026-05-21 16:19:58 +08:00
Yeuvoir 9db7174bc6 pnnx: fix Conv2d padding tuple normalization (#6694)
Normalize 4-element aten pad values from (left, right, top, bottom) to nn.Conv2d padding order (height, width) when fusing Conv2d modules.

Also add regression coverage for asymmetric ZeroPad2d + depthwise Conv2d to keep the output shape and ncnn pad params correct.
2026-05-21 10:17:58 +08:00
476901a510 pnnx print flops and memops (#5836)
---------

Co-authored-by: luxincn <2391719912@qq.com>
Co-authored-by: SZUwishion <2559916473@qq.com>
Co-authored-by: luxincn <luxincn@users.noreply.github.com>
Co-authored-by: Wu YuXuan <148472521+SZUwishion@users.noreply.github.com>
Co-authored-by: nihui <nihui@users.noreply.github.com>
Co-authored-by: luxincn <118981961+luxincn@users.noreply.github.com>
Co-authored-by: nihui <171016+nihui@users.noreply.github.com>
2026-05-07 19:28:58 +08:00
aa01024557 pnnx: support npy input tensors (#6700)
Co-authored-by: lovedream-ms <209071654+lovedream-ms@users.noreply.github.com>
Co-authored-by: lancerstadium <57707690+lancerstadium@users.noreply.github.com>
Co-authored-by: AtomAlpaca <66774326+AtomAlpaca@users.noreply.github.com>
2026-05-06 20:52:04 +08:00
nihui 0d29a8d048 update pnnx torch-2.11 (#6701) 2026-05-06 20:06:51 +08:00
nihui 3e97a6e61c update pnnx ci torch 2.10.0 (#6592)
* Downgrade actions/cache from v5 to v4
2026-03-10 11:49:14 +08:00
nihui 7d357031db pnnx fuse adjacent permute, eliminate noop permute (#6467) 2025-12-26 14:16:34 +08:00
nihui a7c1fc2499 pnnx fix ncnn torch stack shape out-of-range crash with negative axis (#6461) 2025-12-24 10:17:33 +08:00
nihui 232c7ab244 pnnx ncnn convert torch flatten, add test (#6462)
* Update upload-artifact action version to v5
2025-12-23 18:36:47 +08:00
nihui 559a8e8cb0 rotaryembed layer (#6407)
* add deepseek_v3 attention test
* fuse non interleaved rotary embed
* fuse t5 layernorm without gamma
* test qwen2 attention
* sdpa pattern ++
2025-11-19 17:28:08 +08:00
nihui 299b6eae5d fix sdpa attn mask with single channel (#6402) 2025-11-12 19:07:11 +08:00
nihui d73c0d6fd8 pnnx ncnn convert tensor expand to tile, fix missing tile repeats (#6399) 2025-11-12 10:56:57 +08:00
nihui 641a3e5be8 ncnn sdpa layer (#6397)
* fuse gqa
2025-11-11 11:14:04 +08:00
nihui 27ae758da7 pnnx convert interpolate nearest-exact (#6376) 2025-10-28 12:52:57 +08:00
nihui c7a1af0c7e pnnx convert Tensor.unflatten (#6374) 2025-10-27 17:44:00 +08:00
nihui 8903f443aa pnnx fuse more transformer attention variants (#6371)
* pnnx fuse more transformer attention variants
* test new transformers
* always eliminate contiguous
* unified view and reshape
* better float param string
2025-10-27 11:41:12 +08:00
nihui 7b207dd3ad update pnnx ci torch 2.9.0, support onnx external data, enable dynamo exported onnx test (#6364) 2025-10-23 10:07:42 +08:00
nihui cbf4960496 pnnx convert onnx gelu groupnorm rmsnorm (#6330) 2025-09-24 17:35:01 +08:00
nihui 22aba560d8 pnnx convert shrink family to ncnn, fix shrink test (#6329) 2025-09-24 15:22:02 +08:00
nihui a6eda68f23 disable onnx2ncnn build (#6324)
Migrate most of onnx2ncnn functions to pnnx
2025-09-23 19:06:07 +08:00
nihui 9b46272bdf pnnx match more pad-conv patterns, fix ops out of index crash in fuse_constantlist (#6260) 2025-08-19 11:23:56 +08:00
nihui d68ea6b4d5 update pnnx ci torch 2.8.0 (#6238) 2025-08-07 20:33:46 +08:00
nihuiand佰阅 9b91fe5153 implement flip layer and pnnx torch.flip conversion (#6233)
Co-authored-by: 佰阅 <43716063+Baiyuetribe@users.noreply.github.com>
2025-08-06 14:49:16 +08:00
nihui a17e31b2f4 pnnx handles conv convtranspose linear weight norm (#6224) 2025-08-01 17:21:59 +08:00
nihui 171b9d1bba use spdx license header, copyright Tencent (#6152) 2025-07-08 11:01:29 +08:00
nihui ff11080db6 pnnx convert onnx MaxPool auto_pad same, torch reshape_as (#6089) 2025-05-29 17:16:00 +08:00
nihui abb7de9a66 pnnx transformers update part2 (#6072)
* pnnx update batch 1 mask attention, add more clip test

* fuse same qkv input

* skip onnx clip sdpa

* maintain cache
2025-05-26 12:35:58 +08:00
nihui d9d9cc403d pnnx torch logical ops test (#6069) 2025-05-22 11:44:15 +08:00
nihui 5f056b8fee pnnx transformers update, part1 (#6054)
* local cache

* skip transformer test on torch<2.1

* zip pnnx

* bool8 to bool

* initialize xlnet weights

* onnx einsum

* onnx reducelogsumexp

* skip tensor as scalar attribute

* skip longformer
2025-05-20 14:21:11 +08:00
nihui 1d9c78c526 update pnnx ci (#6048) 2025-05-12 20:01:42 +08:00
nihui b8602a6587 pnnx test_inference with torch.no_grad() (#6028) 2025-04-28 18:49:12 +08:00
nihui 65b3530be1 fix pnnx ncnn resolve reshape batch index (#6021)
* handle batch index with dynamic reshape
2025-04-25 17:20:42 +08:00
nihui 76ce92073e update pnnx ci with torch 2.7 (#6018) 2025-04-24 17:36:10 +08:00
nihui 8363040cb4 pnnx ncnn gelu fast mode, fix interp 2d resize (#5999) 2025-04-17 18:53:39 +08:00
nihui ef0b0e631c interp output size expression (#5994) 2025-04-17 14:24:57 +08:00
nihui 39c055d7f2 crop axes starts ends expression (#5976)
* skip dynamic tensor index

* handle clone oom
2025-04-14 19:43:50 +08:00
nihui 4e34da40f1 pnnx convert onnx reducel1 reducel2, add onnx norm test (#5988) 2025-04-13 00:21:11 +08:00
nihui 3b3b7a94a1 pnnx convert onnx globalavgpool, add onnx adaptive avg/max pool test (#5987) 2025-04-11 21:59:04 +08:00
nihui 1d95a9cb41 update pnnx ci with torch 2.6 (#5972) 2025-04-03 10:34:36 +08:00
nihui f3651ce5b8 pnnx convert onnx depth2space, add pixelshuffle pixelunshuffle test (#5967) 2025-04-01 15:19:13 +08:00
nihui 524001bf54 pnnx convert onnx conv with asymmatric pads (#5965)
* pnnx convert onnx conv with asymmatric pads

* pad + conv1d and conv3d

* onnx conv auto_pad
2025-04-01 11:01:27 +08:00
nihui 07267f2618 softmax 4d test and vulkan, softmax unified elempack optimization for x86 arm riscv (#5931) 2025-03-18 16:34:19 +08:00
nihui 6396a732ef reshape shape expression, drop reshape permute, test reshape oom (#5918) 2025-03-10 15:31:34 +08:00
nihui 78aca5d30b pnnx fix onnx clip conversion, add onnx clamp test, always reserve onnx split outputs, convert onnx mod (#5834) 2024-12-19 16:57:30 +08:00
nihui 4b0d2dea24 pnnx auto inputshape from traced inputs (#5825) 2024-12-18 17:29:12 +08:00