Skip to content

Commit

Permalink
#5389: added host buffer wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
arakhmati committed May 16, 2024
1 parent 44e0090 commit 6ebc5f0
Show file tree
Hide file tree
Showing 44 changed files with 573 additions and 460 deletions.
21 changes: 9 additions & 12 deletions tests/tt_eager/integration_tests/test_bert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "tt_metal/common/constants.hpp"
#include "tensor/tensor.hpp"
#include "tensor/owned_buffer.hpp"
#include "tt_metal/host_api.hpp"

#include "tt_numpy/functions.hpp"

#include "tt_dnn/op_library/operation.hpp"
#include <chrono>

#include "tt_dnn/op_library/bmm/bmm_op.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tt_dnn/op_library/bcast/bcast_op.hpp"
#include "tt_dnn/op_library/transformer_tms/transformer_tms.hpp"
#include "tt_dnn/op_library/bmm/bmm_op.hpp"
#include "tt_dnn/op_library/layernorm/layernorm_op.hpp"
#include "tt_dnn/op_library/operation.hpp"
#include "tt_dnn/op_library/softmax/softmax_op.hpp"

#include <chrono>
#include "tt_dnn/op_library/transformer_tms/transformer_tms.hpp"
#include "tt_metal/common/constants.hpp"
#include "tt_metal/host_api.hpp"
#include "tt_numpy/functions.hpp"

using Parameters = std::map<std::string, Tensor>;

Expand Down
4 changes: 2 additions & 2 deletions tests/tt_eager/ops/test_eltwise_binary_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// SPDX-License-Identifier: Apache-2.0

#include "common/constants.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tt_dnn/op_library/eltwise_binary/eltwise_binary_op.hpp"
#include "tt_numpy/functions.hpp"
Expand Down
4 changes: 2 additions & 2 deletions tests/tt_eager/ops/test_eltwise_unary_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <cmath>

#include "common/constants.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tt_dnn/op_library/eltwise_unary/eltwise_unary_op.hpp"
#include "tt_dnn/op_library/operation.hpp"
Expand Down
4 changes: 2 additions & 2 deletions tests/tt_eager/ops/test_multi_queue_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "common/constants.hpp"
#include "queue/queue.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tt_dnn/op_library/eltwise_unary/eltwise_unary_op.hpp"
#include "tt_dnn/op_library/operation.hpp"
Expand Down
8 changes: 3 additions & 5 deletions tests/tt_eager/ops/test_pad_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
#include <cmath>

#include "common/constants.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tensor/owned_buffer.hpp"
#include "tt_dnn/op_library/operation.hpp"
#include "tt_dnn/op_library/pad/pad_op.hpp"
#include "tt_metal/host_api.hpp"

#include "tt_numpy/functions.hpp"

#include "tt_dnn/op_library/pad/pad_op.hpp"
#include "tt_dnn/op_library/operation.hpp"

using tt::tt_metal::DataType;
using tt::tt_metal::Device;

Expand Down
16 changes: 8 additions & 8 deletions tests/tt_eager/ops/test_tilize_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "tt_metal/host_api.hpp"
#include "tensor/tensor.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tt_dnn/op_library/tilize/tilize_op.hpp"
#include "common/constants.hpp"
#include <tt_numpy/functions.hpp>

#include <algorithm>
#include <functional>
#include <random>
#include <tt_numpy/functions.hpp>

#include "common/constants.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tt_dnn/op_library/tilize/tilize_op.hpp"
#include "tt_metal/host_api.hpp"

using namespace tt;
using namespace tt_metal;
Expand Down
17 changes: 8 additions & 9 deletions tests/tt_eager/ops/test_tilize_op_channels_last.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "tt_metal/host_api.hpp"
#include "tensor/tensor.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tt_dnn/op_library/tilize/tilize_op.hpp"
#include "common/constants.hpp"
#include "tt_numpy/functions.hpp"

#include <algorithm>
#include <functional>
#include <random>

#include "common/constants.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tt_dnn/op_library/tilize/tilize_op.hpp"
#include "tt_metal/host_api.hpp"
#include "tt_numpy/functions.hpp"

using namespace tt;
using namespace tt_metal;
using namespace constants;
Expand Down
16 changes: 8 additions & 8 deletions tests/tt_eager/ops/test_tilize_zero_padding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "tt_metal/host_api.hpp"
#include "tensor/tensor.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tt_dnn/op_library/tilize/tilize_op.hpp"
#include "common/constants.hpp"
#include "tt_numpy/functions.hpp"

#include <algorithm>
#include <functional>
#include <random>

#include "common/constants.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tt_dnn/op_library/tilize/tilize_op.hpp"
#include "tt_metal/host_api.hpp"
#include "tt_numpy/functions.hpp"

using namespace tt;
using namespace tt_metal;
using namespace constants;
Expand Down
16 changes: 8 additions & 8 deletions tests/tt_eager/ops/test_tilize_zero_padding_channels_last.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "tt_metal/host_api.hpp"
#include "tensor/tensor.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tt_dnn/op_library/tilize/tilize_op.hpp"
#include "common/constants.hpp"
#include "tt_numpy/functions.hpp"

#include <algorithm>
#include <functional>
#include <random>

#include "common/constants.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tt_dnn/op_library/tilize/tilize_op.hpp"
#include "tt_metal/host_api.hpp"
#include "tt_numpy/functions.hpp"

using namespace tt;
using namespace tt_metal;
using namespace constants;
Expand Down
14 changes: 7 additions & 7 deletions tests/tt_eager/ops/test_transpose_wh_multi_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "tt_metal/host_api.hpp"
#include "tensor/tensor.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tt_dnn/op_library/transpose/transpose_op.hpp"
#include <tt_numpy/functions.hpp>

#include <algorithm>
#include <functional>
#include <random>
#include <tt_numpy/functions.hpp>

#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tt_dnn/op_library/transpose/transpose_op.hpp"
#include "tt_metal/host_api.hpp"

using namespace tt;
using namespace tt_metal;
Expand Down
14 changes: 7 additions & 7 deletions tests/tt_eager/ops/test_transpose_wh_single_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "tt_metal/host_api.hpp"
#include "tensor/tensor.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tt_dnn/op_library/transpose/transpose_op.hpp"
#include <tt_numpy/functions.hpp>

#include <algorithm>
#include <functional>
#include <random>
#include <tt_numpy/functions.hpp>

#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tt_dnn/op_library/transpose/transpose_op.hpp"
#include "tt_metal/host_api.hpp"

using namespace tt;
using namespace tt_metal;
Expand Down
23 changes: 11 additions & 12 deletions tests/tt_eager/tensors/test_async_tensor_apis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "tensor/types.hpp"
#include "tt_metal/host_api.hpp"
#include <algorithm>
#include <chrono>
#include <functional>
#include <random>

#include "common/bfloat16.hpp"
#include "common/constants.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tensor/tensor_impl.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tensor/types.hpp"
#include "tests/tt_metal/tt_metal/unit_tests_common/common/common_fixture.hpp"
#include "tt_dnn/op_library/eltwise_binary/eltwise_binary_op.hpp"
#include "common/bfloat16.hpp"
#include "common/constants.hpp"

#include "tt_metal/host_api.hpp"
#include "tt_numpy/functions.hpp"

#include <algorithm>
#include <chrono>
#include <functional>
#include <random>

using namespace tt;
using namespace tt_metal;
using namespace constants;
Expand Down
19 changes: 9 additions & 10 deletions tests/tt_eager/tensors/test_copy_and_move.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "tt_metal/host_api.hpp"
#include "tensor/tensor.hpp"
#include "tensor/tensor_impl.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "common/bfloat16.hpp"
#include "common/constants.hpp"

#include "tt_numpy/functions.hpp"

#include <algorithm>
#include <functional>
#include <random>

#include "common/bfloat16.hpp"
#include "common/constants.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tensor/tensor_impl.hpp"
#include "tt_metal/host_api.hpp"
#include "tt_numpy/functions.hpp"

using namespace tt;
using namespace tt_metal;
using namespace constants;
Expand Down
16 changes: 8 additions & 8 deletions tests/tt_eager/tensors/test_host_device_loopback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "tt_metal/host_api.hpp"
#include "tensor/tensor.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tt_dnn/op_library/eltwise_binary/eltwise_binary_op.hpp"
#include "common/constants.hpp"
#include "tt_numpy/functions.hpp"

#include <algorithm>
#include <functional>
#include <random>

#include "common/constants.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tt_dnn/op_library/eltwise_binary/eltwise_binary_op.hpp"
#include "tt_metal/host_api.hpp"
#include "tt_numpy/functions.hpp"

using namespace tt;
using namespace tt_metal;
using namespace constants;
Expand Down
19 changes: 9 additions & 10 deletions tests/tt_eager/tensors/test_ranks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "tt_metal/host_api.hpp"
#include "tensor/tensor.hpp"
#include "tensor/tensor_impl.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "common/bfloat16.hpp"
#include "common/constants.hpp"

#include "tt_numpy/functions.hpp"

#include <algorithm>
#include <functional>
#include <random>

#include "common/bfloat16.hpp"
#include "common/constants.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tensor/tensor_impl.hpp"
#include "tt_metal/host_api.hpp"
#include "tt_numpy/functions.hpp"

using namespace tt;
using namespace tt_metal;
using namespace constants;
Expand Down
4 changes: 2 additions & 2 deletions tests/tt_eager/tensors/test_raw_host_memory_pointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "common/bfloat16.hpp"
#include "common/constants.hpp"
#include "tensor/owned_buffer.hpp"
#include "tensor/owned_buffer_functions.hpp"
#include "tensor/host_buffer/functions.hpp"
#include "tensor/host_buffer/types.hpp"
#include "tensor/tensor.hpp"
#include "tensor/tensor_impl.hpp"
#include "tt_dnn/op_library/eltwise_binary/eltwise_binary_op.hpp"
Expand Down
Loading

0 comments on commit 6ebc5f0

Please sign in to comment.