Skip to content

Commit 4087596

Browse files
committed
further addressed comments
1 parent d403b18 commit 4087596

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ggml-cuda.cu

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2460,7 +2460,7 @@ GGML_CALL static enum ggml_status ggml_backend_cuda_graph_compute(ggml_backend_t
24602460
int k=0;
24612461
for (int i = 0; i < cgraph->n_nodes; i++) {
24622462
ggml_tensor * node = cgraph->nodes[i];
2463-
// Identify if the graph needs updated for this token due to the number of elements changing
2463+
// Identify if the graph needs to be updated for this token due to the number of elements changing
24642464
// (identified by inspecting soft max op parameters)
24652465
if(node->op == GGML_OP_SOFT_MAX) {
24662466
if(node->src[1]->ne[1] > 1){
@@ -2489,10 +2489,10 @@ GGML_CALL static enum ggml_status ggml_backend_cuda_graph_compute(ggml_backend_t
24892489
#else
24902490
bool use_cuda_graph = false;
24912491
bool cuda_graph_update_required = false;
2492-
#endif
2492+
#endif // USE_CUDA_GRAPH
24932493

2494-
// Only perfom the graph exection if CUDA graphs are not enebled, or we are capturing the graph.
2495-
// With use of CUDA graphs, the execution will be performed by the graph launch.
2494+
// Only perform the graph execution if CUDA graphs are not enabled, or we are capturing the graph.
2495+
// With the use of CUDA graphs, the execution will be performed by the graph launch.
24962496
if(!use_cuda_graph || cuda_graph_update_required) {
24972497
//temporarily avoid indenting here to make code review easier
24982498
for (int i = 0; i < cgraph->n_nodes; i++) {
@@ -2519,7 +2519,7 @@ GGML_CALL static enum ggml_status ggml_backend_cuda_graph_compute(ggml_backend_t
25192519
}
25202520
}
25212521

2522-
#ifdef USE_CUDA_GRAPH
2522+
#ifdef USE_CUDA_GRAPH
25232523
if(use_cuda_graph && (cuda_graph_update_required)) { // End CUDA graph capture
25242524
CUDA_CHECK(cudaStreamEndCapture(cuda_ctx->stream(), &cuda_graph.graph));
25252525
}
@@ -2541,7 +2541,7 @@ GGML_CALL static enum ggml_status ggml_backend_cuda_graph_compute(ggml_backend_t
25412541
// Subsequent call with non-null argument gets nodes
25422542
CUDA_CHECK(cudaGraphGetNodes(cuda_graph.graph, cuda_graph.nodes, &cuda_graph.num_nodes));
25432543

2544-
// Loop over nodes, and extract kernel parameters fro each node
2544+
// Loop over nodes, and extract kernel parameters from each node
25452545
for(size_t i=0; i<cuda_graph.num_nodes; i++) {
25462546
cudaGraphNodeType node_type;
25472547
CUDA_CHECK(cudaGraphNodeGetType(cuda_graph.nodes[i], &node_type));
@@ -2588,7 +2588,7 @@ GGML_CALL static enum ggml_status ggml_backend_cuda_graph_compute(ggml_backend_t
25882588
CUDA_CHECK(cudaGraphLaunch(cuda_graph.instance, cuda_ctx->stream()));
25892589
}
25902590
cuda_graph.count++;
2591-
#endif
2591+
#endif // USE_CUDA_GRAPH
25922592
return GGML_STATUS_SUCCESS;
25932593
}
25942594

0 commit comments

Comments
 (0)