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

[FOR TEST] Disable command batching in PyTorch spec #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 3 additions & 19 deletions cava/samples/pytorch/pt_opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ ava_identifier(PT_OPT);
ava_number(13);
ava_cxxflags(-I/usr/local/cuda-10.1/include -I${CMAKE_SOURCE_DIR}/cava/headers -DAVA_PRELOAD_CUBIN);
ava_libs(-L/usr/local/cuda-10.1/lib64 -lcudart -lcuda -lcublas -lcudnn -lcufft -lcurand -lcusparse -lcusolver);
ava_guestlib_srcs(extensions/cudnn_optimization.cpp extensions/tf_optimization.cpp extensions/cmd_batching.cpp);
ava_worker_srcs(extensions/cudnn_optimization.cpp extensions/tf_optimization.cpp extensions/cmd_batching.cpp);
ava_common_utility_srcs(extensions/cudart_10.1_utilities.cpp);
ava_guestlib_srcs(../common/extensions/cudart_10.1_utilities.cpp extensions/cudnn_optimization.cpp extensions/tf_optimization.cpp);
ava_worker_srcs(../common/extensions/cudart_10.1_utilities.cpp extensions/cudnn_optimization.cpp extensions/tf_optimization.cpp);
ava_export_qualifier();
ava_soname(libcuda.so libcuda.so.1 libcudart.so.10 libcudart.so.10.1 libcublas.so.10 libcublasLt.so.10 libcudnn.so.7 libcufft.so.10 libcurand.so.10 libcusolver.so.10 libcusparse.so.10);

Expand Down Expand Up @@ -51,12 +50,10 @@ ava_begin_utility;
#include <cusolverDn.h>
#include <cuda_profiler_api.h>
#include <glib.h>

#include "cudart_nw_internal.h"
#include "common/linkage.h"
#include "common/logging.h"
#include "common/extensions/tf_optimization.h"
#include "common/extensions/cmd_batching.h"
#include "common/extensions/cudart_10.1_utilities.hpp"

#if !defined(__dv)
Expand Down Expand Up @@ -303,20 +300,6 @@ __pool_cuEventDestroy(CUevent* hEvent, size_t count)
}
}

/* AvA internal APIs */

void __do_batch_emit(void *command_buffer, size_t total_buffer_size)
{
ava_async;
ava_argument(command_buffer) {
ava_in; ava_buffer(total_buffer_size);
}

if (ava_is_worker) {
// TODO: need to process return values
}
}

/* APIs needed for a minimal program */

char CUDARTAPI
Expand Down Expand Up @@ -22942,3 +22925,4 @@ ava_utility void __helper_worker_init_epilogue() {
ava_guestlib_init_prologue(__helper_guestlib_init_prologue());
ava_guestlib_fini_prologue(__helper_guestlib_fini_prologue());
ava_worker_init_epilogue(__helper_worker_init_epilogue());

5 changes: 0 additions & 5 deletions guestlib/extensions/tf_optimization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ void guestlib_tf_opt_init(void) {

cu_event_pool = g_queue_new();
idle_cu_event_pool = g_queue_new();

/* API batch */
nw_global_cmd_batch = cmd_batch_thread_init();
}

void guestlib_tf_opt_fini(void) {
Expand All @@ -55,8 +52,6 @@ void guestlib_tf_opt_fini(void) {
free_cu_event_pool(idle_cu_event_pool);
g_queue_free(cu_event_pool);
g_queue_free(idle_cu_event_pool);

cmd_batch_thread_fini(nw_global_cmd_batch);
}

int free_cu_event_pool(GQueue *pool) {
Expand Down