Skip to content
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

feat: Add approximate support for GeLU #36

Merged
merged 6 commits into from
Dec 17, 2024
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Format
aturker-synnada committed Dec 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d9ea30a4265481b75913f11bbab2f7a1baa770e7
11 changes: 10 additions & 1 deletion mithril/framework/constraints.py
Original file line number Diff line number Diff line change
@@ -3398,6 +3398,7 @@ def tensor_slice_constraints(
input_shape: ShapeRepr = input._temp_shape
updated_symbols = Updates()
status = False

if input_shape.prefix and output_shape.prefix:
in_uni, out_uni = input_shape[0], output_shape[0]
if in_uni.value is not None and out_uni.value is not None:
@@ -3422,11 +3423,19 @@ def split_constraints(output: Tensor, input: Tensor, split_size: Scalar, axis: S
status = False
split_size_val = split_size.value
axis_val = axis.value
assert output._temp_shape is not None, "Output shape of Split is not set!"
assert input._temp_shape is not None, "Input shape of Split is not set!"
output_shape: ShapeRepr = output._temp_shape
input_shape: ShapeRepr = input._temp_shape
updated_symbols = Updates()

if split_size_val is not TBD and axis_val is not TBD:
assert isinstance(axis_val, ToBeDetermined) or type(axis_val) is int

assert isinstance(split_size_val, ToBeDetermined) or type(split_size_val) is int

if not isinstance(axis_val, ToBeDetermined) and not isinstance(
split_size_val, ToBeDetermined
):
if axis_val >= 0:
if len(input_shape.prefix) > axis_val:
uni_val = input_shape.prefix[axis_val].value