Efficient Data Selection Pipeline Design for Chinese-Developed AI Accelerators

    This article outlines how to design an efficient, reproducible data selection component for Chinese-developed AI accelerator platforms. It covers layered architecture, quality filtering, deduplication, quota-based sampling, heterogeneous execution, and coordination with distributed training, along with performance optimization, observability, reliability, and testing practices.

    As model training scales, data selection is evolving from offline preprocessing into infrastructure that spans data ingestion, sample governance, batch construction, and training feedback.

    For Chinese-developed AI accelerator platforms, the goal is not simply to implement a set of filtering rules. It is to organize quality assessment, deduplication, proportional sampling, and heterogeneous execution into an observable, reproducible, and scalable data pipeline. That pipeline must overlap with computation and communication so that selection does not become a new bottleneck in end-to-end training.

    1. Component Role and Design Boundaries

    The data selection component should serve as an intermediate layer in the data pipeline. It receives data from storage and ingestion systems and produces high-quality training batches with controlled data proportions.

    It should remain decoupled from the training framework through a stable data contract that describes:

    • Sample identifiers
    • Content fingerprints
    • Quality scores
    • Source labels
    • Filtering reasons
    • Version information

    Rules, thresholds, and sampling strategies should remain configurable so that the component can support different tasks.

    The component should not become a general-purpose ETL system. Its core responsibilities are quality filtering, deduplication, quota-based sampling, result writing, and index maintenance. Complex annotation, augmentation, and model training should be handled through plugins or external services.

    Evaluation should cover throughput, end-to-end latency, resource utilization, result consistency, reproducibility, and observability—not just the speed of an individual filtering operation.

    2. Overall Architecture: Layers and Operators

    A practical architecture can be organized into five layers:

    1. Ingestion layer: Reads data manifests and validates formats.
    2. Sharded preprocessing layer: Splits tasks by sample count or byte size into batches that can be processed in parallel.
    3. Selection operator layer: Provides rule-based filtering, model scoring, exact deduplication, approximate deduplication, and quota-based sampling.
    4. Scheduling and execution layer: Coordinates CPUs and accelerators, pipeline overlap, backpressure, and failure retries.
    5. Result governance layer: Writes selected results, indexes, audit logs, and operational metrics.

    The following pseudocode illustrates the main selection flow:

    1. def select_batch(samples, scorer, dedup_index, quota):
    2. candidates = []
    3. for s in samples:
    4. if scorer.score(s) < quality_threshold:
    5. continue
    6. key = fingerprint(s)
    7. if dedup_index.seen(key):
    8. continue
    9. candidates.append(s)
    10. return quota.sample(candidates)

    This example only expresses the core flow. In a production implementation, quality scoring and fingerprint computation should be batched wherever possible. Deduplication indexes need to support merging across shards, while quota-based sampling must keep random seeds and configuration versions traceable.

    3. Core Capabilities and Implementation Considerations

    3.1 Quality Filtering

    Rule-based filters are well suited to deterministic issues, such as missing required fields, abnormal lengths, and matches against sensitive-term lists. Model-based scoring is more suitable for less clear-cut judgments, such as semantic quality and relevance.

    Use both approaches together, retaining audit information such as matched rules, score ranges, and filtering reasons. Thresholds should not be hard-coded. Instead, calibrate them against a small, manually reviewed dataset and manage them as configurable policies.

    3.2 Deduplication

    Exact deduplication can use stable fingerprints and hash indexes. Approximate deduplication can use general methods such as locality-sensitive hashing or MinHash.

    The main challenge is balancing global indexes against distributed shards. A complete global index can consume substantial memory, while sharded indexes may miss duplicates across shard boundaries.

    A practical layered strategy is:

    • Exact deduplication within batches
    • Approximate deduplication across batches
    • Periodic global index merging

    Index maintenance should also support checkpoints and idempotent recovery.

    3.3 Quota-Based Sampling

    Training datasets often require controlled proportions across sources, domains, languages, and quality tiers. The component should support stratified quotas, dynamic weights, and curriculum-based sampling, with versioned sampling configurations.

    Sampling must be reproducible. Changes in parallel execution order should not cause unintended shifts in batch composition.

    3.4 Porting to Heterogeneous Hardware

    When moving data processing logic from general-purpose accelerators to Chinese-developed AI accelerator platforms, the focus should be on abstracting operator semantics, memory layouts, and synchronization—not translating code line by line.

    Prioritize compute-intensive, parallelizable operations, such as scoring, fingerprint computation, and vector similarity calculations. Keep operations with complex branching or irregular memory access on CPUs, using asynchronous copies and batching to reduce cross-device waiting.

    3.5 Coordination with Computation and Communication

    The selection component should align with the data-sharding strategy used by distributed training to avoid redundant reads and cross-node hotspots.

    Prefetching, double buffering, and backpressure can help overlap selection with communication. When selection throughput falls short, expose queue depth, device utilization, and waiting time before simply increasing batch size.

    4. Performance Engineering and Reliability

    Performance optimization should address the entire pipeline. Key techniques include:

    • Batched reads
    • Batched scoring
    • Zero-copy or low-copy transfers
    • Operator fusion
    • Caching frequently accessed index data
    • Bounding out-of-order queues

    Deduplication indexes can use a tiered structure, with hot data in memory and cold data on disk, combined with periodic compaction and merging.

    Reliability requires task-level checkpoints, idempotent retries, output-partition validation, and data lineage records. Every filtering decision should be traceable to the relevant rule, model, and configuration versions.

    At a minimum, observability should include:

    • Input sample counts
    • Filter-match distributions
    • Deduplication hit rates
    • Time spent in each stage
    • Queue backlog
    • Device utilization
    • Output-write failure rates
    • End-to-end throughput

    These metrics help identify whether a bottleneck lies in reading, scoring, deduplication, or writing.

    5. Testing, Validation, and Engineering Practice

    Testing should cover correctness, semantic consistency, stress and long-duration stability, fault injection, and end-to-end acceptance.

    • Correctness tests verify filtering rules and sampling quotas.
    • Semantic consistency tests compare result distributions across different levels of parallelism and sharding strategies.
    • Stress tests examine backpressure behavior and resource limits.
    • Long-duration tests assess sustained stability.
    • Fault-injection tests verify checkpoint recovery and idempotent output writing.
    • End-to-end acceptance tests validate the integrated pipeline against repeatable benchmarks and consistent measurement definitions.

    Acceptance targets can aim to bring critical-path performance close to hardware limits, but results must be evaluated using reproducible benchmark workloads and clearly defined metrics.

    Implementation should begin with a small offline dataset. Validate the data contract and metric definitions before gradually increasing parallelism and data volume. Keep interfaces configurable rather than embedding business rules directly into operators.

    Establish a feedback loop that combines manual review with automated statistics. This helps prevent excessive filtering from reducing data diversity.

    An efficient data selection component for Chinese-developed AI accelerator platforms is fundamentally a systems-engineering effort. Only by bringing together operator design, heterogeneous execution, communication coordination, and observable data governance can it provide a reliable, efficient, and reproducible supply of data to the training pipeline.