Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
85d1d7e
[circle-mlir/models] Fix typo in comment
shs-park Feb 5, 2026
4b91c40
[circle-mlir] Add test models for Range operation
shs-park Feb 8, 2026
6bfaca9
[circle-mlir] Activate test models
shs-park Feb 9, 2026
3698716
[circle-mlir] Introduce Sign pass
shs-park Feb 10, 2026
0d73935
[circle-mlir/models] Fix typo (#16383)
shs-park Feb 12, 2026
15e530d
[circle-mlir/models] Introduce test models for Range op (#16384)
shs-park Feb 12, 2026
02b961e
[circle-mlir] Introduce Range pass (#16385)
shs-park Feb 12, 2026
d9198c9
[compiler/tflchef] Introduce Sign operation (#16387)
shs-park Feb 13, 2026
f0a0fbd
[circle-mlir/tools-test] Activate Range tests (#16386)
shs-park Feb 13, 2026
314cf12
[compiler/tflite2circle] Introduce Sign operation (#16388)
shs-park Feb 19, 2026
b10ec45
[luci/lang,logex] Introduce Sign operation (#16389)
shs-park Feb 19, 2026
b67a03b
[luci/import] Introduce Sign operation (#16392)
shs-park Feb 23, 2026
2cda600
[circle-mlir] Update onnx2circle version (#16396)
shs-park Feb 23, 2026
bef4b9e
[circle-mlir/infra] Update changelog for onnx2circle (#16397)
shs-park Feb 23, 2026
54b1611
[onert] Ensure proper pipeline cleanup on exceptions and shutdown (#1…
batcheu Feb 23, 2026
1c26c19
[luci/export] Introduce Sign operation (#16399)
shs-park Feb 24, 2026
a007098
[luci/service] Introduce Sign operation (#16400)
shs-park Feb 24, 2026
1d538b4
[circle-mlir/models] Add Conv2d_F32_R4_p11_g2 test model (#16395)
batcheu Feb 25, 2026
61ae29c
[luci/partition] Introduce Sign operation (#16401)
shs-park Feb 25, 2026
f4bbc7b
[luci-interpreter] Introduce Sign operation (#16403)
shs-park Feb 25, 2026
41f9c90
[res] Add test recipe for sign operation (#16405)
shs-park Feb 25, 2026
2d02b44
[github] Fix circle-interpreter publishing workflow (#16409)
shs-park Feb 26, 2026
f9fd27b
[luci/tests] Add tests for Sign operation (#16407)
shs-park Feb 26, 2026
d154ca1
[infra/debian] Update changelog for circle-interpreter (#16410)
shs-park Feb 26, 2026
b2f7ae1
Add index bounds checks to fix security vulnerabilities (#16398)
chunseoklee Feb 26, 2026
3e341d1
[onert] Add model verification for I/O consistency (#16402)
batcheu Feb 26, 2026
b689205
[git] Add git-blame-ignore-revs (#16404)
hseok-oh Feb 26, 2026
e891c2b
[circle-mlir] Update intype after padding in ConvOp (#16406)
batcheu Feb 27, 2026
114b12a
[CI] Refactore copyright-check script (#16411)
hseok-oh Feb 27, 2026
07862ee
[CI] Reorganize git hook script (#16412)
hseok-oh Feb 27, 2026
1a95d8c
[circle-mlir/tools-test] Enable Conv2d_F32_R4_p11_g2 tests (#16414)
batcheu Mar 3, 2026
7af0e52
[infra] Enable pre-commit shebang check (#16415)
hseok-oh Mar 4, 2026
30a67e1
[onert] Fix compilation on Ubuntu 25.10 with GCC 15.2.0 (#16356)
arkq Mar 4, 2026
70d7c57
[onert] Simplify NPU execution with blocking runNPU_model (#16413)
batcheu Mar 4, 2026
9adb851
[circle-mlir/infra] Update changelog for onnx2circle (#16417)
shs-park Mar 5, 2026
1c4e9f4
[circle-mlir] Introduce dialect for Sign operation (#16422)
shs-park Mar 6, 2026
b339cd1
[circle-mlir] Introduce test model for Sign operation (#16421)
shs-park Mar 6, 2026
0abb747
Merge branch 'circle-mlir/draft-introduce-sign-op' of github.com:shs-…
shs-park Mar 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions circle-mlir/circle-mlir/lib/dialect/mlir/CircleOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -1946,6 +1946,23 @@ def CIR_ShapeOp: CIR_Op<"shape", [
let hasFolder = 1;
}

def CIR_SignOp: CIR_Op<"sign", [
Pure,
SameOperandsAndResultType]> {
let summary = "Sign operation";
let description = [{
Returns NaN if x is NaN, 0 if x is 0, -1 if x < 0 and 1 if x > 0.
}];

let arguments = (ins
CIR_TensorOf<[F32, F64, I32]>:$x
);

let results = (outs
CIR_TensorOf<[F32, F64, I32]>:$output
);
}

def CIR_SinOp: CIR_Op<"sin", [
Pure,
/*TF_SameOperandsAndResultTypeResolveRef*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#include "ops/ResizeOp.h"
#include "ops/ShapeOp.h"
#include "ops/SigmoidOp.h"
#include "ops/SignOp.h"
#include "ops/SinOp.h"
#include "ops/SliceOp.h"
#include "ops/SoftmaxOp.h"
Expand Down Expand Up @@ -263,6 +264,7 @@ void ConvertONNXToCirclePass::runOnOperation()
patterns.insert<ConvResizeV13>(typeConverter, context);
patterns.insert<ConvShape>(typeConverter, context);
patterns.insert<ConvSigmoid>(typeConverter, context);
patterns.insert<ConvSign>(typeConverter, context);
patterns.insert<ConvSin>(typeConverter, context);
patterns.insert<ConvSlice>(typeConverter, context);
patterns.insert<ConvSoftmax>(typeConverter, context);
Expand Down
53 changes: 53 additions & 0 deletions circle-mlir/circle-mlir/lib/pass/src/ops/SignOp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2026 Samsung Electronics Co., Ltd. All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef __CIRCLE_MLIR_PASS_OPS_SIGN_OP_H__
#define __CIRCLE_MLIR_PASS_OPS_SIGN_OP_H__

#include <circle-mlir/dialect/CircleDialect.h>

#include "ConvertHelper.h"

#include <mlir/Transforms/DialectConversion.h>

#include <src/Dialect/ONNX/ONNXOps.hpp>

namespace mlir
{
namespace Circle
{

class ConvSign : public mlir::OpConversionPattern<mlir::ONNXSignOp>
{
public:
using mlir::OpConversionPattern<mlir::ONNXSignOp>::OpConversionPattern;
using OpAdaptor = typename mlir::ONNXSignOp::Adaptor;

mlir::LogicalResult matchAndRewrite(mlir::ONNXSignOp op, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override
{
mlir::Value input = adaptor.getInput();

rewriter.replaceOpWithNewOp<SignOp>(op, op.getType(), input);

return mlir::success();
}
};

} // namespace Circle
} // namespace mlir

#endif // __CIRCLE_MLIR_PASS_OPS_SIGN_OP_H__
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ AddModel(Pow_F32_R2)
AddModel(Pow_F32_R2_3)
AddModel(Pow_F32_R4)
AddModel(PReLU_F32_R4)
AddModel(Range_F32_R0_1)
AddModel(Reciprocal_F32_R4)
AddModel(ReduceMax_F32_R2)
AddModel(ReduceMax_F32_R2_d0)
Expand Down Expand Up @@ -166,6 +167,7 @@ AddModel(Resize_F32_R4_nearest)
AddModel(Shape_F32_R4)
AddModel(Sigmoid_F32_R2)
AddModel(Sigmoid_F32_R4)
AddModel(Sign_F32_R4)
AddModel(Sin_F32_R4)
AddModel(Slice_F32_R2_4) # Rank2 of Slice_F32_R4_4
AddModel(Slice_F32_R3_4) # Rank3 of Slice_F32_R4_4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ AddModel(QuantizeLinear_F32_R3_ui8)
AddModel(QuantizeLinear_F32_R3_ui8_fq)
AddModel(QuantizeLinear_F32_R4_i16_cw)
AddModel(QuantizeLinear_F32_R4_ui8_cw)
AddModel(Range_F32_R0_1)
AddModel(Reciprocal_F32_R4)
AddModel(ReduceMax_F32_R2)
AddModel(ReduceMax_F32_R2_d0)
Expand Down Expand Up @@ -175,6 +176,7 @@ AddModel(Rsqrt_F32_R4)
AddModel(Shape_F32_R4)
AddModel(Sigmoid_F32_R2)
AddModel(Sigmoid_F32_R4)
AddModel(Sign_F32_R4)
AddModel(Sin_F32_R4)
AddModel(Slice_F32_R2_4) # Rank2 of Slice_F32_R4_4
AddModel(Slice_F32_R3_4) # Rank3 of Slice_F32_R4_4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ AddModel(PReLU_F32_R4)
# AddModel(QuantizeLinear_F32_R3_ui8_fq)
# AddModel(QuantizeLinear_F32_R4_i16_cw)
# AddModel(QuantizeLinear_F32_R4_ui8_cw)
AddModel(Range_F32_R0_1)
AddModel(Reciprocal_F32_R4)
AddModel(ReduceMax_F32_R2)
AddModel(ReduceMax_F32_R2_d0)
Expand Down Expand Up @@ -175,6 +176,7 @@ AddModel(Rsqrt_F32_R4)
AddModel(Shape_F32_R4)
AddModel(Sigmoid_F32_R2)
AddModel(Sigmoid_F32_R4)
AddModel(Sign_F32_R4)
AddModel(Sin_F32_R4)
AddModel(Slice_F32_R2_4) # Rank2 of Slice_F32_R4_4
AddModel(Slice_F32_R3_4) # Rank3 of Slice_F32_R4_4
Expand Down
20 changes: 20 additions & 0 deletions circle-mlir/models/unit/Range_F32_R0_1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import torch


# Generate Range operator with Float32, scalar
class net_Range(torch.nn.Module):
def __init__(self):
super().__init__()

def forward(self, input):
limit = input
return torch.arange(0, limit, 1, dtype=torch.float32)

def onnx_opset_version(self):
return 11


_model_ = net_Range()

# produce float32 scalar with fixed number
_inputs_ = torch.tensor(10, dtype=torch.float32)
19 changes: 19 additions & 0 deletions circle-mlir/models/unit/Range_F32_R0_2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import torch


# Generate Range operator with Float32, scalar
class net_Range(torch.nn.Module):
def __init__(self):
super().__init__()

def forward(self, limit, delta):
return torch.arange(0, limit, delta, dtype=torch.float32)

def onnx_opset_version(self):
return 11


_model_ = net_Range()

# produce float32 scalar with fixed number
_inputs_ = (torch.tensor(10, dtype=torch.float32), torch.tensor(1, dtype=torch.float32))
19 changes: 19 additions & 0 deletions circle-mlir/models/unit/Range_F32_R0_3/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import torch


# Generate Range operator with Float32, scalar
class net_Range(torch.nn.Module):
def __init__(self):
super().__init__()

def forward(self, start, limit, delta):
return torch.arange(start, limit, delta, dtype=torch.float32)

def onnx_opset_version(self):
return 11


_model_ = net_Range()

# produce float32 scalar with fixed number
_inputs_ = (torch.tensor(0, dtype=torch.float32), torch.tensor(10, dtype=torch.float32), torch.tensor(1, dtype=torch.float32))
19 changes: 19 additions & 0 deletions circle-mlir/models/unit/Sign_F32_R4/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import torch


# Generate Sign operator with Float32, Rank-4
class net_Sign(torch.nn.Module):
def __init__(self):
super().__init__()

def forward(self, input):
return torch.sign(input)

def onnx_opset_version(self):
# TODO set to appropriate value
return 14


_model_ = net_Sign()

_inputs_ = torch.randn(1, 2, 3, 3)
2 changes: 1 addition & 1 deletion circle-mlir/models/unit/Unsqueeze_F32_R0/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ def onnx_opset_version(self):

_model_ = net_Unsqueeze()

# produuce float32 scalar
# produce float32 scalar
_inputs_ = torch.randn(1)[0]
2 changes: 1 addition & 1 deletion circle-mlir/models/unit/Unsqueeze_F32_R0_v11/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ def onnx_opset_version(self):

_model_ = net_Unsqueeze()

# produuce float32 scalar
# produce float32 scalar
_inputs_ = torch.randn(1)[0]
Loading