Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
v-Golubev committed Oct 10, 2024
1 parent 8853fa9 commit 7204352
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ void BrgemmCopyBKernel::emit_brgemm_copy_b_kernel_call(size_t N, size_t K, size_
spill.postamble();
}

uintptr_t base_addr_src = 0;
uintptr_t base_addr_dst = 0;

void BrgemmCopyBKernel::execute(matmul::jit_brgemm_matmul_copy_b_t* kernel, const void* src, const void* dst, const void* comp, size_t N, size_t K) {
auto ctx = matmul::jit_brgemm_matmul_copy_b_t::ctx_t();
ctx.current_N_blk = N;
Expand All @@ -248,36 +245,14 @@ void BrgemmCopyBKernel::execute(matmul::jit_brgemm_matmul_copy_b_t* kernel, cons
ctx.current_K_start = 0;
ctx.current_K_iters = K;

if (base_addr_src == 0)
base_addr_src = reinterpret_cast<uintptr_t>(src);
else
std::cout << "Stride from base_addr_src = " << reinterpret_cast<uintptr_t>(src) - base_addr_src << std::endl;
if (base_addr_dst == 0)
base_addr_dst = reinterpret_cast<uintptr_t>(dst);
else
std::cout << "Stride from base_addr_dst = " << reinterpret_cast<uintptr_t>(dst) - base_addr_dst << std::endl;

OV_CPU_JIT_EMITTER_ASSERT(kernel, "Kernel hasn't been created");
if (std::getenv("REFERENCE")) {
(*kernel)(&ctx);
std::cout << "Ref Repacked, KN = " << K * N << std::endl;
const auto* data = reinterpret_cast<const bfloat16*>(dst);
for (size_t i = 0; i < K * N; ++i) {
std::cout << static_cast<float>(data[i]) << "\t";
}
std::cout << "\n";
} else {
auto srcPtr = static_cast<const uint8_t*>(src);
auto dstPtr = const_cast<uint8_t*>(static_cast<const uint8_t*>(dst));

auto copySize = K * N * sizeof(bfloat16);
cpu_memcpy(dstPtr, srcPtr, copySize);
std::cout << "Just copy, KN = " << K * N << std::endl;
const auto* data = reinterpret_cast<const bfloat16*>(dst);
for (size_t i = 0; i < K * N; ++i) {
std::cout << static_cast<float>(data[i]) << "\t";
}
std::cout << "\n";
}
}

Expand Down Expand Up @@ -348,11 +323,7 @@ void BrgemmCopyBKernelExecutor::execute(const BrgemmCopyBKernelExecutor* executo
auto kernel = executor->get_kernel();
OV_CPU_JIT_EMITTER_ASSERT(kernel, "has nullptr kernel");
OV_CPU_JIT_EMITTER_ASSERT(args, "has nullptr call args");
auto s = args->src;
auto d = args->tr_src;
std::cerr << s << " : " << d << "\n";
(*kernel)(args);
std::cerr << "\n";
}

} // namespace intel_cpu
Expand Down
17 changes: 0 additions & 17 deletions src/plugins/intel_cpu/src/nodes/subgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,23 +881,6 @@ void Subgraph::execute(dnnl::stream strm) {
repacked_memory->load(*srcMemPtrs[1]);
if (!std::getenv("REFERENCE"))
srcMemPtrs[1] = repacked_memory;

// TODO: remove
const auto& input_shape = getSrcMemoryAtPort(0)->getDescPtr()->getShape().getStaticDims();
const auto& b_shape = getSrcMemoryAtPort(1)->getDescPtr()->getShape().getStaticDims();
const auto K = DnnlExtensionUtils::convertToDnnlDim(*input_shape.rbegin());
const auto N = DnnlExtensionUtils::convertToDnnlDim(*b_shape.rbegin());
auto* data = repacked_memory->getDataAs<const bfloat16>();
std::cout << "Repacked, KN = " << K * N << std::endl;
auto upper_bound = repacked_memory->getSize();
for (decltype(upper_bound) i = 0; i < upper_bound; ++i) {
std::cout << static_cast<float>(data[i]) << "\t";
if (static_cast<float>(data[i]) == 5.21875f) {
// std::cout << "Stride is found: " << i << std::endl;
upper_bound = i + K * N;
}
}
std::cout << "\n";
}
execPtr->exec(srcMemPtrs, dstMemPtrs);
}
Expand Down

0 comments on commit 7204352

Please sign in to comment.