diff --git a/dorado/basecall/metal/nn.metal b/dorado/basecall/metal/nn.metal index 435814cae..322d2d3cb 100644 --- a/dorado/basecall/metal/nn.metal +++ b/dorado/basecall/metal/nn.metal @@ -434,12 +434,12 @@ kernel void conv( */ struct RowMajor { - static int inner(int /* r */, int c) { return c; } - static int outer(int r, int /* c */) { return r; } + static ulong inner(int /* r */, int c) { return c; } + static ulong outer(int r, int /* c */) { return r; } }; struct ColMajor { - static int inner(int r, int /* c */) { return r; } - static int outer(int /* r */, int c) { return c; } + static ulong inner(int r, int /* c */) { return r; } + static ulong outer(int /* r */, int c) { return c; } }; // 2D matrix layouts using 8x8 tiles. Note that RowMajor/ColMajor apply to the order of tiles, *NOT* within tiles // RC == RowMajor: layout RrCc, where: R = row / 8; r = row % 8; C = col / 8; c = col % 8 diff --git a/dorado/read_pipeline/BasecallerNode.cpp b/dorado/read_pipeline/BasecallerNode.cpp index 354bd6983..29a585efa 100644 --- a/dorado/read_pipeline/BasecallerNode.cpp +++ b/dorado/read_pipeline/BasecallerNode.cpp @@ -87,9 +87,7 @@ void BasecallerNode::input_thread_fn() { // Now that we have acquired a read, wait until we can push to chunks_in // Chunk up the read and put the chunks into the pending chunk list. - size_t raw_size = - read_common_data.raw_data - .sizes()[read_common_data.raw_data.sizes().size() - 1]; // Time dimension. + size_t raw_size = read_common_data.raw_data.sizes().back(); // Time dimension. size_t chunk_queue_idx = get_chunk_queue_idx(raw_size); size_t chunk_size = m_chunk_sizes[chunk_queue_idx]; @@ -101,7 +99,7 @@ void BasecallerNode::input_thread_fn() { read_chunks.emplace_back(std::make_unique( working_read, offset, chunk_in_read_idx++, chunk_size)); size_t num_chunks = 1; - auto last_chunk_offset = raw_size - chunk_size; + auto last_chunk_offset = raw_size > chunk_size ? raw_size - chunk_size : 0; auto misalignment = last_chunk_offset % m_model_stride; if (misalignment != 0) { // move last chunk start to the next stride boundary. we'll zero pad any excess samples required.