Skip to content

Commit ebd6192

Browse files
committed
Revert "moves cli"
This reverts commit 71f1093.
1 parent 71f1093 commit ebd6192

11 files changed

Lines changed: 884 additions & 990 deletions

File tree

‎examples/caller_allocated_output.cpp‎

Lines changed: 0 additions & 117 deletions
This file was deleted.

‎include/pipeline/compressor.h‎

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -134,40 +134,6 @@ class Pipeline {
134134
cudaStream_t stream = 0
135135
);
136136

137-
/**
138-
* Compress into a caller-allocated device buffer.
139-
*
140-
* @param d_input Device pointer to raw input.
141-
* @param input_size Input size in bytes.
142-
* @param d_output Caller-allocated device buffer for compressed bytes.
143-
* @param output_capacity Capacity of d_output in bytes.
144-
* @param output_size Receives the compressed size in bytes.
145-
* @param stream CUDA stream for all GPU operations.
146-
*/
147-
void compressInto(
148-
const void* d_input,
149-
size_t input_size,
150-
void* d_output,
151-
size_t output_capacity,
152-
size_t* output_size,
153-
cudaStream_t stream = 0
154-
);
155-
156-
/**
157-
* Compress multi-source input into a caller-allocated device buffer.
158-
*
159-
* Output format matches compress(const std::vector<InputSpec>&):
160-
* single output buffer for single-source pipelines; concat format for
161-
* multi-source pipelines.
162-
*/
163-
void compressInto(
164-
const std::vector<InputSpec>& inputs,
165-
void* d_output,
166-
size_t output_capacity,
167-
size_t* output_size,
168-
cudaStream_t stream = 0
169-
);
170-
171137
/**
172138
* Compress (multi-source). One InputSpec per source stage; order does not matter.
173139
* *d_output is pool-owned — do NOT cudaFree.
@@ -211,45 +177,6 @@ class Pipeline {
211177
cudaStream_t stream = 0
212178
);
213179

214-
/**
215-
* Decompress into a caller-allocated device buffer (single-source only).
216-
*
217-
* @param d_input nullptr to read from live forward DAG buffers, or
218-
* a device pointer to external compressed bytes.
219-
* @param input_size Byte size of d_input (ignored when d_input is nullptr).
220-
* @param d_output Caller-allocated device buffer for decompressed bytes.
221-
* @param output_capacity Capacity of d_output in bytes.
222-
* @param output_size Receives the exact decompressed size in bytes.
223-
* @param stream CUDA stream for all GPU operations.
224-
*/
225-
void decompressInto(
226-
const void* d_input,
227-
size_t input_size,
228-
void* d_output,
229-
size_t output_capacity,
230-
size_t* output_size,
231-
cudaStream_t stream = 0
232-
);
233-
234-
/**
235-
* Decompress multi-source data into caller-allocated output buffers.
236-
*
237-
* @param d_input nullptr to read from live forward DAG buffers,
238-
* or a device pointer to external compressed bytes.
239-
* @param input_size Byte size of d_input (ignored when d_input is nullptr).
240-
* @param d_outputs One device pointer per source output.
241-
* @param output_capacities Capacity (bytes) for each output pointer.
242-
* @param stream CUDA stream for all GPU operations.
243-
* @return Exact decompressed size (bytes) for each source output.
244-
*/
245-
std::vector<size_t> decompressMultiInto(
246-
const void* d_input,
247-
size_t input_size,
248-
const std::vector<void*>& d_outputs,
249-
const std::vector<size_t>& output_capacities,
250-
cudaStream_t stream = 0
251-
);
252-
253180
/**
254181
* Decompress (multi-source). Returns one {device_ptr, size} pair per source,
255182
* in the same order as forward source discovery. Ownership follows
@@ -261,32 +188,6 @@ class Pipeline {
261188
cudaStream_t stream = 0
262189
);
263190

264-
/**
265-
* Maximum compressed output size for the current finalized pipeline.
266-
*
267-
* Returned value is an upper bound suitable for caller allocation before
268-
* compressInto(...). For multi-source pipelines this corresponds to the
269-
* single concat output format returned by compress().
270-
*/
271-
size_t getMaxCompressedOutputSize() const;
272-
273-
/**
274-
* Maximum decompressed output size (single-source pipelines only).
275-
*
276-
* Value is derived from the most recent compress() input size when available,
277-
* otherwise from finalize-time size hints. Returns an upper bound suitable
278-
* for caller allocation before decompressInto().
279-
*/
280-
size_t getMaxDecompressedOutputSize() const;
281-
282-
/**
283-
* Maximum decompressed output size per source (multi-source aware).
284-
*
285-
* Order matches decompressMulti()/decompressMultiInto() source order.
286-
* Values are upper bounds suitable for caller allocation.
287-
*/
288-
std::vector<size_t> getMaxDecompressedOutputSizes() const;
289-
290191
/** Free non-persistent buffers and reset execution state for re-use. */
291192
void reset(cudaStream_t stream = 0);
292193

@@ -369,12 +270,6 @@ class Pipeline {
369270
/** Parse the FZM header from a file without decompressing the payload. */
370271
static FZMFileHeader readHeader(const std::string& filename);
371272

372-
/** Exact decompressed output size from an FZM file (single-source convenience). */
373-
static size_t getDecompressedOutputSizeFromFile(const std::string& filename);
374-
375-
/** Exact decompressed output sizes (one per source) from an FZM file header. */
376-
static std::vector<size_t> getDecompressedOutputSizesFromFile(const std::string& filename);
377-
378273
/** Build the FZM header from current pipeline state. Requires a prior compress(). */
379274
FZMFileHeader buildHeader() const;
380275

@@ -437,14 +332,6 @@ class Pipeline {
437332
std::vector<Stage*> getSourceStages() const;
438333
std::vector<Stage*> getSinkStages() const;
439334

440-
std::vector<std::pair<void*, size_t>> decompressMultiImpl(
441-
const void* d_input,
442-
size_t input_size,
443-
cudaStream_t stream,
444-
const std::vector<void*>* caller_outputs,
445-
const std::vector<size_t>* caller_capacities
446-
);
447-
448335
// ── Inverse DAG helpers ───────────────────────────────────────────────────
449336

450337
/** Compact description of one forward stage used by buildInverseDAG(). */

‎src/pipeline/compressor.cpp‎

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -584,95 +584,6 @@ size_t Pipeline::getPoolThreshold() const {
584584
return mem_pool_ ? mem_pool_->getConfiguredSize() : 0;
585585
}
586586

587-
size_t Pipeline::getMaxCompressedOutputSize() const {
588-
if (!is_finalized_) {
589-
throw std::runtime_error(
590-
"getMaxCompressedOutputSize() requires finalize() to be called first");
591-
}
592-
if (!dag_) {
593-
throw std::runtime_error("getMaxCompressedOutputSize(): DAG is not initialized");
594-
}
595-
if (output_buffer_ids_.empty()) {
596-
throw std::runtime_error(
597-
"getMaxCompressedOutputSize(): pipeline has no detected output buffers");
598-
}
599-
600-
if (!needs_concat_) {
601-
return dag_->getBufferSize(output_buffer_ids_[0]);
602-
}
603-
604-
// Mirror concat format capacity computation using buffer capacities rather
605-
// than run-time actual sizes.
606-
auto align16_local = [](size_t x) -> size_t { return (x + 15u) & ~15u; };
607-
608-
const size_t n = output_buffer_ids_.size();
609-
size_t total = align16_local(sizeof(uint32_t) + n * sizeof(uint64_t));
610-
for (int buf_id : output_buffer_ids_) {
611-
total += align16_local(dag_->getBufferSize(buf_id));
612-
}
613-
return total;
614-
}
615-
616-
std::vector<size_t> Pipeline::getMaxDecompressedOutputSizes() const {
617-
if (!is_finalized_) {
618-
throw std::runtime_error(
619-
"getMaxDecompressedOutputSizes() requires finalize() to be called first");
620-
}
621-
622-
std::vector<size_t> out;
623-
out.reserve(input_nodes_.size());
624-
625-
for (size_t i = 0; i < input_nodes_.size(); ++i) {
626-
size_t max_size = 0;
627-
628-
// Most accurate value: actual source size from the most recent compress().
629-
if (i < source_input_sizes_.size() && source_input_sizes_[i] > 0) {
630-
max_size = source_input_sizes_[i];
631-
}
632-
633-
// Fallback: per-source finalize-time hint.
634-
if (max_size == 0) {
635-
Stage* src_stage = input_nodes_[i]->stage;
636-
auto hint_it = per_source_hints_.find(src_stage);
637-
if (hint_it != per_source_hints_.end() && hint_it->second > 0) {
638-
max_size = hint_it->second;
639-
}
640-
}
641-
642-
// Fallback: constructor hint (single-source common case).
643-
if (max_size == 0 && input_size_hint_ > 0) {
644-
max_size = input_size_hint_;
645-
}
646-
647-
// Final fallback: finalized DAG input buffer size if it is not the
648-
// placeholder 1-byte value used when no hint is available.
649-
if (max_size == 0 && i < input_buffer_ids_.size() && dag_) {
650-
const size_t dag_size = dag_->getBufferSize(input_buffer_ids_[i]);
651-
if (dag_size > 1) max_size = dag_size;
652-
}
653-
654-
// Returned value is a max allocation size; preserve alignment rounding.
655-
if (max_size > 0 && input_alignment_bytes_ > 1) {
656-
max_size = ((max_size + input_alignment_bytes_ - 1) / input_alignment_bytes_)
657-
* input_alignment_bytes_;
658-
}
659-
660-
out.push_back(max_size);
661-
}
662-
663-
return out;
664-
}
665-
666-
size_t Pipeline::getMaxDecompressedOutputSize() const {
667-
auto sizes = getMaxDecompressedOutputSizes();
668-
if (sizes.size() != 1) {
669-
throw std::runtime_error(
670-
"getMaxDecompressedOutputSize() is single-source only; use getMaxDecompressedOutputSizes() for " +
671-
std::to_string(sizes.size()) + " source outputs");
672-
}
673-
return sizes[0];
674-
}
675-
676587
size_t Pipeline::getCurrentMemoryUsage() const {
677588
return dag_ ? dag_->getCurrentMemoryUsage() : 0;
678589
}

0 commit comments

Comments
 (0)