Skip to content

Commit e26cdac

Browse files
committed
Update
[ghstack-poisoned]
2 parents e9cda82 + c8311e6 commit e26cdac

33 files changed

+211
-91
lines changed

.github/scripts/propose_ghstack_orig_pr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def create_prs_for_orig_branch(pr_stack: List[int], repo: Repository):
101101
# gh/user/x/orig is the clean diff between gh/user/x/base <- gh/user/x/head
102102
orig_branch_merge_head = pr.base.ref.replace("base", "orig")
103103
bot_metadata = f"""This PR was created by the merge bot to help merge the original PR into the main branch.
104-
ghstack PR number: https://github.com/pytorch/executorch/pull/{pr.number}
104+
ghstack PR number: https://github.com/pytorch/executorch/pull/{pr.number} by @{pr.user.login}
105105
^ Please use this as the source of truth for the PR details, comments, and reviews
106106
ghstack PR base: https://github.com/pytorch/executorch/tree/{pr.base.ref}
107107
ghstack PR head: https://github.com/pytorch/executorch/tree/{pr.head.ref}

backends/cadence/aot/compiler_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-strict
48

backends/cadence/aot/fuse_ops.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-unsafe
48

backends/cadence/aot/graph_builder.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-strict
48

backends/cadence/aot/memory_constraints.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

7+
# pyre-unsafe
38

49
import logging
510
import math

backends/cadence/aot/pass_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-strict
48

backends/cadence/aot/remove_ops.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-strict
48

backends/cadence/aot/reorder_ops.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-unsafe
48

backends/cadence/aot/replace_ops.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37

48
# This file contains all the functions that replace one op with another in the

backends/cadence/aot/simplify_ops.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-unsafe
48

backends/cadence/aot/tests/test_fusion_ops_passes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-unsafe
48

backends/cadence/aot/tests/test_graph_builder.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-strict
48

backends/cadence/aot/tests/test_memory_passes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-unsafe
48

backends/cadence/aot/tests/test_pass_filter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-unsafe
48

backends/cadence/aot/tests/test_remove_ops_passes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-unsafe
48

backends/cadence/aot/tests/test_reorder_ops_passes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-unsafe
48

backends/cadence/aot/tests/test_replace_ops_passes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-unsafe
48

backends/cadence/aot/tests/test_simplify_ops_passes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-unsafe
48

backends/cadence/hifi/operators/op_quantized_fully_connected_out.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
29
#include <executorch/backends/cadence/hifi/kernels/kernels.h>
310
#include <executorch/runtime/kernel/kernel_includes.h>
411

backends/cadence/hifi/operators/op_quantized_relu_out.cpp

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ void quantized_relu_per_tensor_out(
2626
const int64_t out_multiplier,
2727
const int64_t out_shift,
2828
Tensor& output) {
29-
const uint8_t _in_zero_point = static_cast<uint8_t>(in_zero_point);
30-
const uint8_t _out_zero_point = static_cast<uint8_t>(out_zero_point);
31-
const int32_t _out_multiplier = static_cast<int32_t>(out_multiplier);
32-
const int32_t _out_shift = static_cast<int32_t>(out_shift);
29+
const int32_t _out_multiplier = static_cast<int32_t>(out_multiplier);
30+
const int32_t _out_shift = static_cast<int32_t>(out_shift);
31+
3332
if (input.scalar_type() == executorch::aten::ScalarType::Byte) {
33+
const uint8_t _in_zero_point = static_cast<uint8_t>(in_zero_point);
34+
const uint8_t _out_zero_point = static_cast<uint8_t>(out_zero_point);
3435
const uint8_t* p_in = input.const_data_ptr<uint8_t>();
3536
uint8_t* p_out = output.mutable_data_ptr<uint8_t>();
3637

@@ -48,6 +49,8 @@ void quantized_relu_per_tensor_out(
4849
ET_CHECK_MSG(ret_val == 0, "An internal error occured");
4950

5051
} else if (input.scalar_type() == executorch::aten::ScalarType::Char) {
52+
const int8_t _in_zero_point = static_cast<int8_t>(in_zero_point);
53+
const int8_t _out_zero_point = static_cast<int8_t>(out_zero_point);
5154
const int8_t* p_in = input.const_data_ptr<int8_t>();
5255
int8_t* p_out = output.mutable_data_ptr<int8_t>();
5356

@@ -72,28 +75,6 @@ void quantized_relu_per_tensor_out(
7275
}
7376
}
7477

75-
void quantized_relu_per_tensor_out(
76-
KernelRuntimeContext& ctx,
77-
const Tensor& input,
78-
const Tensor& in_zero_point,
79-
const int64_t out_zero_point,
80-
const Tensor& out_multiplier,
81-
const Tensor& out_shift,
82-
Tensor& output) {
83-
int8_t _in_zero_point = in_zero_point.const_data_ptr<int8_t>()[0];
84-
int32_t _out_multiplier = out_multiplier.const_data_ptr<int32_t>()[0];
85-
int32_t _out_shift = out_shift.const_data_ptr<int32_t>()[0];
86-
87-
quantized_relu_per_tensor_out(
88-
ctx,
89-
input,
90-
_in_zero_point,
91-
out_zero_point,
92-
_out_multiplier,
93-
_out_shift,
94-
output);
95-
}
96-
9778
} // namespace native
9879
} // namespace HiFi
9980
} // namespace impl

backends/cadence/hifi/operators/operators.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
28

39
#pragma once
410

backends/cadence/reference/operators/im2row_out.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
28

39
#include <executorch/backends/cadence/reference/operators/operators.h>
410

backends/cadence/reference/operators/operators.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
28

39
#pragma once
410

backends/cadence/reference/operators/quantized_conv_out.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
28

39
#include <executorch/backends/cadence/reference/kernels/kernels.h>
410
#include <executorch/backends/cadence/reference/operators/operators.h>

backends/cadence/reference/operators/quantized_ops.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
28

39
#pragma once
410

backends/cadence/utils/facto_util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-strict
48

backends/xnnpack/test/quantizer/test_pt2e_quantization.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree
26

37
# pyre-unsafe
48

examples/cadence/operators/test_add_op.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
26

37
# pyre-unsafe
48

examples/models/llama/export_llama.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
# Example script for exporting Llama2 to flatbuffer
88

99
import logging
10+
11+
# force=True to ensure logging while in debugger. Set up logger before any
12+
# other imports.
13+
FORMAT = "[%(levelname)s %(asctime)s %(filename)s:%(lineno)s] %(message)s"
14+
logging.basicConfig(level=logging.INFO, format=FORMAT, force=True)
15+
1016
import sys
1117

1218
import torch
@@ -16,10 +22,6 @@
1622
sys.setrecursionlimit(4096)
1723

1824

19-
FORMAT = "[%(levelname)s %(asctime)s %(filename)s:%(lineno)s] %(message)s"
20-
logging.basicConfig(level=logging.INFO, format=FORMAT)
21-
22-
2325
def main() -> None:
2426
seed = 42
2527
torch.manual_seed(seed)

exir/_serialize/padding.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree
26

37
# pyre-strict
48

exir/passes/quantize_io_pass.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree
6+
27
import logging
38
from typing import Any, Dict, List, Optional, Union
49

0 commit comments

Comments
 (0)