From 2a6cb31542d4305d74848d66fea42d85b60d7aa5 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Sat, 14 Nov 2026 16:48:12 +0100 Subject: [PATCH] cuda-driver: explicit imports (571 -> 2 production globs); explicit_imports.py: prune by the non-test build plus the test tokens of the file Co-Authored-By: Claude Sonnet 5.5 --- crates/cuda-driver/src/api/async_api.rs | 3 -- crates/cuda-driver/src/api/driver_backed.rs | 2 +- .../src/api/driver_backed/batch_copy.rs | 2 +- .../cuda-driver/src/arch_ptx/stream_k_off.rs | 5 ++- crates/cuda-driver/src/batch_gr_preview.rs | 5 ++- .../cuda-driver/src/bringup_trace_enabled.rs | 5 ++- .../cuda-driver/src/closed_kernels/program.rs | 7 ++- .../src/closed_kernels/s_gemv_slots.rs | 3 +- .../flash_and_poison_signatures_match.rs | 7 ++- .../tests/sealed_assets_match_their_pins.rs | 3 +- .../src/closed_kernels_gpu/closed_kernels.rs | 8 +++- .../closed_kernels_flash_and_s_gemv.rs | 7 ++- .../closed_kernels_open_admit_run.rs | 6 ++- .../src/closed_kernels_gpu/failure.rs | 3 +- .../src/closed_kernels_gpu_smoke/cases.rs | 6 ++- .../src/closed_kernels_gpu_smoke/rng.rs | 3 +- crates/cuda-driver/src/context.rs | 6 ++- .../context_gate_up_projection_admission.rs | 7 ++- .../src/context_matvec_k_quant_projections.rs | 6 ++- .../src/context_projection_kernel_slots.rs | 6 ++- .../context_q8_1_and_gate_up_projection.rs | 6 ++- .../src/context_unload_close_destroy.rs | 3 +- crates/cuda-driver/src/device_buffer.rs | 5 ++- .../cuda-driver/src/experimental/kv_shape.rs | 6 ++- crates/cuda-driver/src/experimental/mode.rs | 7 ++- .../src/experimental_gpu/context.rs | 5 ++- .../src/experimental_gpu/facade_launches.rs | 10 ++++- .../facade_launches/attention_launch.rs | 7 ++- .../attention_launch/attend_inputs.rs | 6 ++- .../program_and_kv_pool_launches.rs | 7 ++- .../call_shape.rs | 3 +- .../step_operands.rs | 3 +- .../stream_keyless_cvec_launches.rs | 8 +++- .../q8_gather_and_resolve_launch.rs | 6 ++- .../src/experimental_gpu/operands.rs | 3 +- .../src/experimental_gpu/stream_map.rs | 6 ++- crates/cuda-driver/src/ffi/api.rs | 3 -- crates/cuda-driver/src/ffi/context_handle.rs | 4 +- crates/cuda-driver/src/ffi/driver_backed.rs | 8 +++- .../cuda-driver/src/ffi/driver_backed/api.rs | 6 ++- .../device_context_memory_copies.rs | 3 +- .../src/ffi/driver_backed/library_drop.rs | 3 +- .../library_load_fixed_operations.rs | 10 ++++- .../fixed_selectors.rs | 6 ++- .../matvec_projection_launches.rs | 6 ++- .../mmq_original_group_launches.rs | 6 ++- .../mmq_resident_qsa_selected_launches.rs | 6 ++- crates/cuda-driver/src/ffi/function_handle.rs | 10 ++++- .../src/ffi/q5_projection_arguments_drop.rs | 3 +- .../src/ffi/qsa_selected_arguments.rs | 3 +- crates/cuda-driver/src/gdn_closed_queue.rs | 5 ++- .../src/gdn_closed_queue/gdn_queue_stage.rs | 6 ++- .../src/gdn_closed_queue/gdn_row_prefix.rs | 8 +++- .../gdn_row_prefix/convolution_stages.rs | 6 ++- .../gdn_row_prefix_fenced_drain.rs | 6 ++- .../gdn_row_prefix/recurrence_stages.rs | 7 ++- .../src/gdn_closed_queue/gdn_row_queue.rs | 3 +- .../src/gdn_closed_queue_gpu/bytes.rs | 6 ++- .../columns_pair_cases.rs | 6 ++- .../src/gdn_closed_queue_gpu/scenarios.rs | 7 ++- crates/cuda-driver/src/gdn_fused_t1.rs | 2 +- .../src/gdn_fused_t1/gdn_fused_prefix.rs | 7 ++- .../gdn_fused_prefix/fused_stage_binding.rs | 6 ++- .../gdn_fused_prefix_step_norm_drain.rs | 7 ++- .../gdn_fused_t1/gdn_fused_t1_lifecycle.rs | 6 ++- crates/cuda-driver/src/gdn_fused_t1/pinned.rs | 6 ++- crates/cuda-driver/src/gdn_fused_t1/words.rs | 6 ++- crates/cuda-driver/src/gdn_native_batch.rs | 2 +- .../src/gdn_native_batch/context.rs | 7 ++- .../src/gdn_native_batch/gdn_batch_prefix.rs | 7 ++- .../gdn_batch_prefix/native_projection.rs | 6 ++- .../gdn_batch_prefix/qkv_and_z_projections.rs | 6 ++- .../gdn_batch_prefix/recurrence_and_output.rs | 7 ++- .../src/gdn_native_batch/pinned.rs | 7 ++- .../src/gdn_native_batch/staging.rs | 3 +- .../cuda-driver/src/gdn_native_batch_abi.rs | 2 +- .../src/gdn_native_batch_gpu/bytes_of.rs | 3 +- .../gdn_native_batch_gpu/host_gemm_adapter.rs | 7 ++- .../src/gdn_native_batch_gpu/run_case.rs | 7 ++- crates/cuda-driver/src/gdn_prompt_device.rs | 6 ++- .../src/gdn_prompt_device/context.rs | 3 +- .../original_gdn_prompt_device.rs | 9 +++- .../gdn_prompt_run_buffer_binder.rs | 6 ++- .../original_gdn_prompt_device_admit_open.rs | 6 ++- .../original_gdn_prompt_device_close.rs | 3 +- .../original_gdn_prompt_device_drain.rs | 6 ++- .../prompt_block_produce.rs | 7 ++- .../prompt_command_list.rs | 6 ++- .../prompt_tensor_core_scan.rs | 5 ++- .../original_gdn_prompt_device_drop.rs | 3 +- .../cuda-driver/src/gdn_state_finite_guard.rs | 2 +- .../src/gr_batch_inject_workspace.rs | 2 +- crates/cuda-driver/src/gr_batch_read.rs | 5 ++- .../cuda-driver/src/gr_batch_read/context.rs | 3 +- .../src/gr_batch_read/gr_microbatch_read.rs | 6 ++- .../gr_microbatch_read_inject.rs | 6 ++- .../gr_microbatch_read_open.rs | 6 ++- .../gr_microbatch_read/micro_stage_launch.rs | 6 ++- .../gr_batch_read/gr_microbatch_read_drop.rs | 3 +- crates/cuda-driver/src/gr_native_batch.rs | 2 +- .../src/gr_native_batch/context.rs | 3 +- .../gr_native_batch/gr_native_batch_drop.rs | 3 +- .../gr_native_batch_operations.rs | 6 ++- .../native_command_drain.rs | 6 ++- .../native_gemm_launch.rs | 6 ++- .../native_inject.rs | 6 ++- crates/cuda-driver/src/gr_read_guard.rs | 7 ++- .../grouped_numeric_run.rs | 6 ++- .../src/grouped_gu21_gu23_gpu/guards.rs | 5 ++- .../grouped_upload_run.rs | 6 ++- .../src/grouped_gu21_gu23_nc4_gpu/guards.rs | 5 ++- crates/cuda-driver/src/head_greedy.rs | 4 +- .../cuda-driver/src/iq3_native_integer_mma.rs | 2 +- .../src/kar_decode_levels_gpu/context.rs | 6 ++- .../src/kar_decode_levels_gpu/expert_mlp.rs | 6 ++- .../src/kar_decode_levels_gpu/f32_bytes.rs | 3 +- .../kar_decode_levels.rs | 7 ++- .../src/kv_stream_gpu/append_proof.rs | 6 ++- crates/cuda-driver/src/kv_stream_gpu/rng.rs | 5 ++- .../src/kv_stream_gpu/stream_proof.rs | 7 ++- .../src/mapped_expert_bank/context.rs | 6 ++- .../mapped_expert_bank_drop.rs | 6 ++- .../mapped_expert_bank_operations.rs | 6 ++- .../mapped_expert_bank_close.rs | 3 +- .../mapped_expert_bank_pcie_and_triplets.rs | 6 ++- .../mapped_expert_bank_pieces_and_pinning.rs | 6 ++- crates/cuda-driver/src/mmq.rs | 7 ++- crates/cuda-driver/src/mmq/asset.rs | 3 +- crates/cuda-driver/src/mmq/context.rs | 6 ++- crates/cuda-driver/src/mmq/experiment_load.rs | 3 +- crates/cuda-driver/src/mmq/mmq_experiment.rs | 6 ++- .../src/mmq/mmq_experiment_drop.rs | 6 ++- crates/cuda-driver/src/mmq/release_triplet.rs | 3 +- crates/cuda-driver/src/mmq/tile.rs | 3 +- crates/cuda-driver/src/mmq_ffi.rs | 2 +- .../mmq_ffi/mmq_original_gather_arguments.rs | 3 +- .../src/mmq_ffi/mmq_resident_arguments.rs | 7 ++- crates/cuda-driver/src/mmq_ffi/owned.rs | 3 +- crates/cuda-driver/src/mmq_native.rs | 2 +- .../cuda-driver/src/mmq_native_activation.rs | 2 +- crates/cuda-driver/src/mmq_native_down.rs | 5 ++- .../src/mmq_native_resident_gpu/digest.rs | 5 ++- .../native_hidden_q8.rs | 3 +- .../cuda-driver/src/mmq_numeric_gpu/digest.rs | 6 ++- .../src/mmq_numeric_gpu/format_cases.rs | 3 +- .../chunk_issuing.rs | 3 +- .../mmq_original_chunk_stream/chunk_stream.rs | 6 ++- crates/cuda-driver/src/mmq_original_group.rs | 7 ++- .../src/mmq_original_group/asset.rs | 6 ++- .../src/mmq_original_group/copy_ring_layer.rs | 7 ++- .../src/mmq_original_group/kind.rs | 6 ++- .../src/mmq_original_group/mmq_workspace.rs | 6 ++- .../mmq_original_group/original_mmq_layer.rs | 7 ++- .../original_mmq_layer/finite_and_quantize.rs | 6 ++- .../original_mmq_layer/group_projection.rs | 7 ++- .../original_mmq_layer_stage_experts.rs | 5 ++- .../mmq_original_group/original_mmq_output.rs | 5 ++- .../src/mmq_original_host_stage/host_stage.rs | 6 ++- .../mmq_original_host_stage/verify_enabled.rs | 4 +- crates/cuda-driver/src/mmq_original_ring.rs | 2 +- .../original_mmq_copy_schedule.rs | 7 ++- .../original_mmq_copy_schedule_drop.rs | 3 +- .../cuda-driver/src/mmq_original_ring/ring.rs | 8 +++- .../ring/ring_construction.rs | 3 +- .../ring/ring_gather_and_finish.rs | 3 +- .../mmq_original_ring/ring/ring_prefetch.rs | 3 +- .../ring/ring_stage_expert_copies.rs | 6 ++- .../src/mmq_original_ring/ring_drop.rs | 3 +- .../src/mmq_original_ring/ring_init.rs | 7 ++- .../mmq_original_ring/ring_prefetch_issue.rs | 6 ++- .../src/mmq_original_ring/skip_expert_dma.rs | 6 ++- .../src/mmq_original_ring/stream_start.rs | 3 +- .../src/mmq_original_stream_all.rs | 6 ++- .../group_producer_gather_project.rs | 7 ++- .../original_mmq_layer.rs | 6 ++- .../src/mmq_original_stream_all/transport.rs | 6 ++- .../cuda-driver/src/mmq_original_weights.rs | 2 +- crates/cuda-driver/src/mmq_resident.rs | 8 +++- crates/cuda-driver/src/mmq_resident/asset.rs | 3 +- .../src/mmq_resident/mmq_workspace.rs | 7 ++- .../mmq_workspace/mmq_workspace_bring_up.rs | 8 +++- .../mmq_workspace_gate_up_chunk_close.rs | 3 +- .../mmq_workspace/projection_plan.rs | 7 ++- .../src/mmq_resident/mmq_workspace_drop.rs | 7 ++- .../src/mmq_resident_gpu/digest.rs | 6 ++- .../live_packet_alias_drop.rs | 3 +- .../src/mmq_resident_gpu/native_owner.rs | 6 ++- .../src/mmq_resident_gpu/owner_proof.rs | 6 ++- .../src/mmq_resident_gpu/queued_proof.rs | 7 ++- .../src/mmq_resident_gpu/resident_chain.rs | 7 ++- .../cuda-driver/src/moe_group_down_columns.rs | 5 ++- .../cuda-driver/src/moe_group_projection.rs | 18 +++++++- crates/cuda-driver/src/moe_prefill_batch.rs | 2 +- .../src/moe_prefill_batch/moe_batch_prefix.rs | 8 +++- .../moe_batch_prefix/combine_stage.rs | 7 ++- .../moe_batch_prefix_router_pack.rs | 6 ++- .../shared_expert_projections.rs | 6 ++- .../moe_prefill_batch_lifecycle.rs | 7 ++- .../src/moe_prefill_batch/pinned.rs | 6 ++- .../src/moe_prefill_batch/words.rs | 3 +- .../src/moe_prefill_batch_gpu/bytes_of.rs | 5 ++- .../clean_window_check.rs | 6 ++- .../src/moe_prefill_batch_gpu/fixture.rs | 7 ++- .../moe_prefill_batch_gpu/program_cases.rs | 6 ++- crates/cuda-driver/src/mtp_input_workspace.rs | 5 ++- .../mtp_input_completion.rs | 7 ++- .../mtp_input_workspace/mtp_input_prefix.rs | 7 ++- .../mtp_input_workspace_lifecycle.rs | 3 +- .../src/mtp_input_workspace_gpu/bytes.rs | 6 ++- .../mtp_input_workspace_gpu/numeric_case.rs | 6 ++- .../src/mtp_original_check_batch_program.rs | 8 +++- .../src/mtp_original_full_drafter.rs | 8 +++- .../completed_original_mtp_draft.rs | 3 +- .../original_mtp_drafter.rs | 10 ++++- .../original_mtp_drafter_finish_chain.rs | 8 +++- .../original_mtp_drafter_keep_bank.rs | 3 +- .../original_mtp_drafter_launch_rounds.rs | 8 +++- .../original_mtp_drafter_new_draft.rs | 7 ++- .../original_mtp_drafter_pipelined_chain.rs | 6 ++- .../original_mtp_drafter_from_verifier.rs | 7 ++- .../mtp_original_full_ffi/driver_backed.rs | 2 +- .../src/mtp_original_full_forward.rs | 12 +++++- .../src/mtp_original_full_forward/context.rs | 3 +- .../context_original_mtp_shared_layout.rs | 6 ++- .../full_forward_prefix_program.rs | 10 ++++- .../full_forward_program_alias_checks.rs | 8 +++- .../original_mtp_full_forward.rs | 9 +++- .../prefix_parts.rs | 8 +++- .../prefix_rows.rs | 6 ++- .../mtp_original_full_forward/full_owned.rs | 6 ++- .../matrix_vector_buffers_and_shape.rs | 7 ++- .../full_forward_final_gr_stages.rs | 6 ++- .../full_forward_finite_tail_mlp_gr.rs | 7 ++- .../full_forward_moe_block_plan.rs | 6 ++- .../original_mtp_full_forward.rs | 7 ++- .../original_mtp_forward_program.rs | 7 ++- ...inal_mtp_forward_program_original_graph.rs | 3 +- .../original_mtp_full_forward.rs | 6 ++- .../original_mtp_retained_prefix.rs | 7 ++- .../validate_scalar_prefix.rs | 6 ++- .../src/mtp_original_full_graph.rs | 2 +- .../cuda-driver/src/mtp_original_full_init.rs | 6 ++- .../src/mtp_original_full_round.rs | 7 ++- .../original_mtp_draft_program.rs | 6 ++- .../mtp_original_full_round/post_select.rs | 6 ++- .../src/mtp_original_full_round/put.rs | 7 ++- .../mtp_original_full_round/staged_source.rs | 8 +++- .../src/mtp_original_full_symbols.rs | 2 +- .../mtp_original_full_symbols/assets_types.rs | 3 +- .../chain_asset_types.rs | 3 -- .../mtp_original_int8/mtp_int8_owner_id.rs | 7 ++- .../mtp_original_int8_operations.rs | 10 ++++- .../mtp_original_int8_attend_split_k.rs | 6 ++- .../mtp_original_int8_kv_only_replay.rs | 7 ++- .../mtp_original_int8_restore.rs | 5 ++- .../mtp_original_int8_ring_bring_up.rs | 8 +++- .../mtp_original_int8_validate_execute.rs | 7 ++- .../mtp_original_int8_state_adoption.rs | 6 ++- .../src/mtp_original_int8/physical_ring.rs | 6 ++- .../src/mtp_original_int8_ffi/arguments.rs | 3 +- .../mtp_original_int8_ffi/driver_backed.rs | 2 +- .../src/mtp_original_int8_ffi/host_enabled.rs | 2 +- .../src/mtp_original_logical_prefix.rs | 5 ++- .../src/mtp_original_native_embedding.rs | 4 +- .../cuda-driver/src/mtp_original_prefill.rs | 7 ++- .../completed_draft_kv.rs | 6 ++- .../original_mtp_prefill.rs | 10 ++++- .../original_mtp_prefill/block_commands.rs | 7 ++- .../original_mtp_prefill/kernel_commands.rs | 7 ++- .../original_mtp_prefill_close.rs | 3 +- .../projection_commands.rs | 6 ++- .../original_mtp_prefill/record_operands.rs | 6 ++- .../original_mtp_prefill/record_walk.rs | 9 +++- .../original_mtp_prefill/run_and_settle.rs | 6 ++- .../original_mtp_prefill_drop.rs | 3 +- .../src/mtp_original_prefill/region.rs | 3 +- .../src/mtp_original_ring_state.rs | 5 ++- .../src/mtp_original_ring_state/a16.rs | 3 +- .../mtp_original_ring_state/cleanup_fns.rs | 2 +- .../mtp_original_ring_state/pin_failure.rs | 6 ++- .../src/mtp_original_ring_state/selected.rs | 6 ++- .../src/mtp_original_scalar_graph.rs | 6 ++- .../src/mtp_original_scalar_prefill.rs | 9 +++- ...raph_resources_original_graph_resources.rs | 5 ++- .../original_mtp_scalar_prefill.rs | 12 +++++- .../call_admission.rs | 9 +++- .../group_capture.rs | 5 ++- .../original_mtp_scalar_prefill/group_loop.rs | 8 +++- .../kernel_commands.rs | 7 ++- .../original_mtp_scalar_prefill_admit_new.rs | 7 ++- .../original_mtp_scalar_prefill_close.rs | 3 +- .../original_mtp_scalar_prefill_record_gr.rs | 7 ++- .../record_operands.rs | 7 ++- .../original_mtp_scalar_prefill_drop.rs | 3 +- .../src/mtp_original_scalar_weights.rs | 5 ++- .../cuda-driver/src/mtp_original_session.rs | 5 ++- .../original_mtp_session_plan.rs | 3 +- .../original_mtp_session_resources.rs | 7 ++- .../session_owned_drop.rs | 6 ++- .../cuda-driver/src/native_head/dispatch.rs | 3 +- .../cuda-driver/src/native_head/head_owned.rs | 8 +++- .../src/native_head/iq_entries_types.rs | 6 ++- .../src/native_head/native_asset.rs | 6 ++- .../src/native_head/native_asset_pin_types.rs | 6 ++- .../src/native_head/native_entries_types.rs | 3 -- .../src/native_head/original_native_embed.rs | 7 ++- ...iginal_native_embed_rows_original_graph.rs | 3 +- .../native_head/original_native_head_rows.rs | 8 +++- ...original_native_head_rows_greedy_submit.rs | 8 +++- .../original_native_head_rows_sampling.rs | 6 ++- ...al_native_head_rows_drop_original_graph.rs | 7 ++- ...iginal_native_head_rows_original_native.rs | 6 ++- .../src/native_head/projection_commands.rs | 6 ++- .../src/native_parity/native_parity_expert.rs | 5 ++- .../native_parity/native_parity_operations.rs | 7 ++- .../native_parity_dequantize_diagnostics.rs | 6 ++- .../native_parity_expert_enqueue.rs | 7 ++- .../src/native_parity/parity_session.rs | 6 ++- .../src/native_parity/sealed_ptx.rs | 3 +- .../original_device_block.rs | 7 ++- .../original_ple_history.rs | 3 +- .../original_prompt_device.rs | 9 +++- .../original_prompt_device/gr_read_phases.rs | 3 +- .../original_prompt_device/inject_phases.rs | 6 ++- .../original_prompt_device_apply_ple.rs | 4 +- .../original_prompt_device_bring_up.rs | 7 ++- .../original_prompt_device_close_modules.rs | 3 +- .../original_prompt_device_gr_read_plan.rs | 5 ++- .../original_prompt_device_initialize_rows.rs | 5 ++- .../original_prompt_device_inject_gr.rs | 5 ++- .../original_prompt_device_read_gr.rs | 6 ++- .../ple_apply_phases.rs | 7 ++- .../original_prompt_device/run_phases.rs | 6 ++- .../original_prompt_device_drop.rs | 3 +- .../src/native_prompt_device/stage_phases.rs | 5 ++- .../src/native_prompt_device_stage.rs | 8 +++- .../original_cache_prefix.rs | 3 +- .../original_expert_cache_drop.rs | 3 +- .../original_expert_cache_operations.rs | 7 ++- .../original_expert_cache_adaptive_swaps.rs | 6 ++- .../original_expert_cache_batched_refill.rs | 5 ++- .../original_expert_cache_file_slot_fill.rs | 6 ++- .../original_expert_cache_open_and_slots.rs | 6 ++- .../original_expert_cache_verify_and_lend.rs | 6 ++- .../src/original_expert_stager/context.rs | 9 +++- .../original_expert_stager_lifecycle.rs | 6 ++- .../original_stager_batch.rs | 8 +++- .../original_stager_options.rs | 6 ++- .../original_expert_stager/stager_workers.rs | 7 ++- .../src/original_expert_stager_ffi/api.rs | 6 ++- .../src/original_expert_stager_ffi/check.rs | 3 +- .../original_expert_stager_ffi/host_buffer.rs | 3 +- .../available_memory.rs | 3 +- .../file_expert_source_swap_exchanges.rs | 6 ++- .../original_file_expert_source_operations.rs | 8 +++- .../build_phases.rs | 6 ++- .../file_expert_source_cache_complement.rs | 2 +- .../file_expert_source_prefetch.rs | 6 ++- .../file_expert_source_stages_and_blobs.rs | 6 ++- .../file_expert_source_status_counters.rs | 7 ++- .../fill_workers.rs | 3 +- .../original_resident_options_and_blob.rs | 7 ++- .../original_file_expert_source_ffi/arena.rs | 3 +- .../original_file_expert_source_ffi/check.rs | 3 +- .../src/original_gpu_head_bridge.rs | 2 +- .../original_gpu_graph.rs | 7 ++- .../original_gpu_stream.rs | 8 +++- .../original_gpu_stream/capture_phases.rs | 7 ++- .../original_graph_key.rs | 6 ++- .../set_side_streams_wanted.rs | 6 ++- .../src/original_gpu_schedule/transport.rs | 6 ++- .../src/original_gpu_schedule_ffi/api.rs | 3 -- .../src/original_gpu_schedule_ffi/platform.rs | 2 +- .../original_gpu_schedule_ffi/platform/api.rs | 9 +++- .../platform/async_copies_and_flag_writes.rs | 3 +- .../platform/library_drop.rs | 3 +- .../src/original_gpu_verify_bridge.rs | 2 +- .../src/original_moe_prompt_device/blank.rs | 6 ++- .../original_moe_prompt_device_drop.rs | 7 ++- .../original_moe_prompt_device_operations.rs | 8 +++- .../original_moe_prompt_device_new_run.rs | 7 ++- .../original_moe_prompt_device_prepare.rs | 5 ++- .../original_moe_prompt_device_release.rs | 3 +- .../prepare_phases.rs | 7 ++- .../original_mtp_actor_loaded/inconsistent.rs | 5 ++- .../original_mtp_actor.rs | 10 ++++- .../original_mtp_actor/draft_rounds.rs | 7 ++- .../original_mtp_actor_adopt_loaded.rs | 8 +++- .../original_mtp_actor_drop.rs | 3 +- .../src/original_mtp_round_lifecycle.rs | 6 ++- .../original_mtp_drafter.rs | 8 +++- .../original_mtp_prefill_plan.rs | 7 ++- .../public_draft_output_copy.rs | 3 +- .../src/original_mtp_rt/read_index.rs | 6 ++- .../src/original_mtp_rt/rt_error.rs | 3 +- .../src/original_prefill_arena/ple_extent.rs | 3 +- .../original_prefill_layout/carve_parts.rs | 3 +- .../original_prefill_layout/mmq_identity.rs | 3 +- .../cuda-driver/src/original_sampler/asset.rs | 3 +- .../original_sampler/original_sampler_drop.rs | 3 +- .../original_sampler_operations.rs | 6 ++- .../original_sampler_bring_up.rs | 6 ++- .../original_sampler_close_resources.rs | 3 +- .../original_sampler_coupled_draft.rs | 3 +- .../original_sampler_run_verify_window.rs | 6 ++- .../src/original_session_state/add.rs | 3 +- .../original_session_layout.rs | 8 +++- .../original_session_layout/new_phases.rs | 7 ++- .../src/original_session_state/qsa_price.rs | 7 ++- crates/cuda-driver/src/original_stream_all.rs | 7 ++- .../original_expert_stager.rs | 9 +++- .../original_stream_all_options.rs | 10 ++++- .../original_expert_stager.rs | 5 ++- .../original_stream_all.rs | 7 ++- .../original_stream_all/walk.rs | 6 ++- .../original_stream_all_options_issuer.rs | 6 ++- .../stream_phases.rs | 9 +++- .../original_verify_gdn_journal.rs | 9 +++- .../original_verify_window.rs | 3 +- .../verify_gdn_fused_step.rs | 3 +- .../verify_gdn_journal_ladder_logits_scan.rs | 7 ++- .../verify_gdn_journal_stage_and_commit.rs | 6 ++- .../verify_gdn_journal_window_launches.rs | 6 ++- .../original_verify/original_verify_rearm.rs | 7 ++- .../original_verify/share_window_modules.rs | 9 +++- .../original_verify_bank.rs | 7 ++- .../share_window_modules/physical.rs | 6 ++- .../verify_bank_and_canonical_gdn_open.rs | 7 ++- .../verify_bank_plan_and_window_rows.rs | 8 +++- .../src/original_verify_gpu_plan.rs | 2 +- .../cpu_sink_publish_gpu_plan.rs | 6 ++- .../dma_options_for.rs | 3 -- .../original_verify_gpu_plan_encoding.rs | 3 +- .../original_verify_gpu_plan/plan_phases.rs | 7 ++- .../src/original_verify_schedule.rs | 9 +++- .../commit_sync_forced.rs | 7 ++- .../original_verifier.rs | 7 ++- .../verifier_commit_window_lifecycle.rs | 7 ++- .../verifier_logits_diagnostics_close.rs | 7 ++- .../verifier_park_rearm.rs | 8 +++- .../original_verify_schedule/window_phases.rs | 8 +++- .../src/original_verify_window_gr/assets.rs | 9 +++- .../original_verify_window_gr/fused_down.rs | 7 ++- .../original_verify_window_gr/head_chain.rs | 7 ++- .../original_verify_window_gr/plan_hc_read.rs | 8 +++- .../plan_head_mix_multi.rs | 5 ++- .../original_verify_window_gr/plan_ple_row.rs | 12 +++++- .../tests/fused_down_launches.rs | 6 ++- .../tests/head_chain_launches.rs | 6 ++- .../tests/head_mix_is_the_native.rs | 8 +++- .../tests/head_mix_multi.rs | 6 ++- .../tests/tiled_down_projection_covers.rs | 7 ++- .../pcie_fast_kernel.rs | 8 +++- .../plan_expert_groups.rs | 8 +++- .../plan_f32_to_bf16.rs | 8 +++- .../tests/alternative_pcie_staging_copy.rs | 7 ++- .../tests/down_sub16_plan.rs | 6 ++- .../tests/hit_add_scans_the_cpu.rs | 6 ++- .../tests/shared_gate_without_native_bf16.rs | 8 +++- .../src/original_verify_window_ops.rs | 6 ++- .../all_window_assets.rs | 10 ++++- .../original_verify_window_ops/gdn_stages.rs | 3 +- .../hits_combine.rs | 5 ++- .../original_verifier.rs | 6 ++- .../qsa_prelude_ops.rs | 3 +- .../side_qsa_branches.rs | 3 +- .../side_shared_expert.rs | 3 +- .../original_verify_window_ops/wait_rows.rs | 3 +- .../window_launches.rs | 6 ++- .../window_ops_kernels_and_pcie_plan.rs | 7 ++- .../tests/combine_head_switches.rs | 3 +- .../tests/every_window_size_and_group.rs | 5 ++- .../tests/fused_gr_down.rs | 3 +- .../tests/fused_qsa_prelude.rs | 6 ++- .../tests/head_chain_batch.rs | 3 +- .../admit_matrix.rs | 7 ++- .../head_iq_entries_types.rs | 3 +- .../head_native_entries_types.rs | 3 -- .../q8_1_row_bytes.rs | 7 ++- .../src/original_verify_window_qsa/assets.rs | 8 +++- .../original_verify_window_qsa/qsa_window.rs | 9 +++- .../qsa_window/qsa_window_prelude_rows.rs | 3 +- .../qsa_window/qsa_window_query_key_paths.rs | 7 ++- .../qsa_window_select_and_attend.rs | 7 ++- .../tests/q_path_per_token_splits.rs | 6 ++- .../tests/sealed_assets_are_pinned.rs | 7 ++- .../tests/weight_sizes_are_the_original.rs | 6 ++- .../src/ple_batch_ffi/driver_backed.rs | 5 ++- .../src/ple_batch_ffi/driver_backed/blas.rs | 6 ++- .../kernel_module_launch_and_close.rs | 7 ++- .../ple_batch_ffi/driver_backed/library.rs | 3 +- .../src/ple_batch_ffi/kernel_arguments.rs | 3 +- .../cuda-driver/src/ple_batch_queue/assets.rs | 7 ++- .../ple_batch_queue/ple_batch_queue_drop.rs | 3 +- .../ple_batch_queue_operations.rs | 7 ++- .../compose_phases.rs | 6 ++- .../ple_batch_queue_bring_up.rs | 6 ++- .../ple_batch_queue_close.rs | 3 +- .../ple_batch_queue_compose.rs | 2 +- crates/cuda-driver/src/ple_closed_queue.rs | 5 ++- .../src/ple_closed_queue/compose_phases.rs | 6 ++- .../src/ple_closed_queue/float_owner.rs | 3 +- .../ple_closed_queue/ple_closed_completion.rs | 7 ++- .../ple_closed_queue_compose_close.rs | 4 +- .../src/prefill_stage_gdn_gpu/enable_types.rs | 3 +- .../gdn_recurrence_equals_the_original.rs | 6 ++- .../gdn_tensor_core_scan_parity.rs | 3 +- .../src/prefill_stage_gdn_gpu/rng.rs | 3 +- .../src/prefill_stage_gr_gpu/enable_types.rs | 3 +- .../gr_fused_guards_equal.rs | 6 ++- .../gr_kernels_run_near_their.rs | 3 +- .../src/prefill_stage_gr_gpu/rng.rs | 3 +- .../src/projection_grids_and_bounds.rs | 3 +- .../src/prompt_sync_trace_types.rs | 5 ++- .../src/prompt_sync_trace_types/retained.rs | 5 ++- crates/cuda-driver/src/q5_kshape_types.rs | 3 +- crates/cuda-driver/src/q6_k_shape.rs | 3 +- crates/cuda-driver/src/q6_layer_preview.rs | 4 +- .../src/qsa_index_ffi/driver_backed.rs | 2 +- crates/cuda-driver/src/qsa_late_gpu/rng.rs | 3 +- .../cuda-driver/src/qsa_late_gpu/scan_both.rs | 6 ++- .../src/qsa_late_gpu/time_scores_and_topk.rs | 5 ++- crates/cuda-driver/src/qsa_mapped_journal.rs | 8 +++- .../original_qsa_mapped_journal.rs | 7 ++- .../original_qsa_mapped_prefix.rs | 7 ++- .../qsa_mapped_journal_append_and_resolve.rs | 5 ++- .../qsa_mapped_journal_prefix_and_prefetch.rs | 7 ++- crates/cuda-driver/src/qsa_native_batch.rs | 2 +- .../qsa_native_batch/native_projections.rs | 7 ++- .../src/qsa_native_batch/qsa_native_kind.rs | 6 ++- .../attention_kernel_plan_and_passes.rs | 8 +++- .../attention_passes.rs | 7 ++- .../prompt_attention_owner.rs | 8 +++- .../reject_mutual_alias.rs | 3 +- .../qsa_attention_inputs.rs | 3 +- .../qsa_prompt_attention_drop.rs | 3 +- crates/cuda-driver/src/qsa_prompt_device.rs | 6 ++- .../src/qsa_prompt_device/context.rs | 6 ++- .../src/qsa_prompt_device/device_phases.rs | 9 +++- .../src/qsa_prompt_device/device_prepare.rs | 6 ++- .../original_qsa_prompt_device.rs | 6 ++- .../src/qsa_prompt_device/project_phases.rs | 7 ++- .../qsa_prompt_device/selection_completion.rs | 7 ++- .../src/qsa_prompt_device_attention.rs | 2 +- .../src/qsa_prompt_device_index.rs | 5 ++- .../cuda-driver/src/qsa_prompt_device_kv.rs | 2 +- crates/cuda-driver/src/qsa_prompt_index.rs | 5 ++- .../src/qsa_prompt_index/append_select.rs | 6 ++- .../src/qsa_prompt_index/index_rows.rs | 2 +- .../src/qsa_prompt_index/index_run.rs | 5 ++- .../src/qsa_prompt_index/max_blocks.rs | 3 +- .../qsa_prompt_index_read_and_close.rs | 6 ++- .../qsa_prompt_index_workspace.rs | 7 ++- .../src/qsa_prompt_index/run_launches.rs | 3 +- .../src/qsa_prompt_index/run_phases.rs | 6 ++- .../cuda-driver/src/qsa_prompt_kv/offsets.rs | 6 ++- .../src/qsa_prompt_kv/qsa_prompt_kv_drop.rs | 7 ++- .../src/qsa_prompt_kv/staged_append.rs | 8 +++- .../staged_append/append_phases.rs | 6 ++- .../qsa_prompt_kv_append_bounded_close.rs | 6 ++- .../staged_append/qsa_prompt_kv_bring_up.rs | 8 +++- .../cuda-driver/src/qsa_resident_attention.rs | 5 ++- crates/cuda-driver/src/qsa_resident_decode.rs | 2 +- crates/cuda-driver/src/qsa_resident_device.rs | 8 +++- .../original_qsa_prompt_device.rs | 8 +++- .../qsa_prompt_device_resident_bring_up.rs | 7 ++- .../qsa_resident_prompt_device_prepare.rs | 9 +++- crates/cuda-driver/src/qsa_resident_index.rs | 7 ++- .../src/qsa_resident_index/image_bytes.rs | 6 ++- .../original_qsa_index_batch.rs | 5 ++- .../original_qsa_resident_index.rs | 7 ++- .../qsa_resident_index_checkpoint_restore.rs | 6 ++- .../src/qsa_resident_index_program.rs | 5 ++- .../qsa_resident_index_program/arena_plan.rs | 3 +- .../prefix_replay.rs | 5 ++- .../qsa_prompt_index_workspace.rs | 6 ++- .../src/qsa_resident_scalar_index.rs | 6 ++- .../src/qsa_resident_transfer/enabled.rs | 2 +- .../cuda-driver/src/qsa_resident_transport.rs | 5 ++- crates/cuda-driver/src/qsa_selected_kv.rs | 4 +- .../cuda-driver/src/qsa_selected_kv/asset.rs | 3 +- .../qsa_selected_kv_attend_io.rs | 6 ++- .../qsa_selected_kv_workspace.rs | 7 ++- .../src/qsa_verification_commit.rs | 5 ++- .../original_verify_qsa_journal.rs | 7 ++- .../original_verify_rope.rs | 3 +- .../verify_qsa_journal_capture_commit.rs | 6 ++- .../verify_qsa_journal_index_image.rs | 3 +- .../verify_qsa_journal_loan.rs | 6 ++- .../verify_qsa_journal_publish_discard.rs | 6 ++- .../verify_qsa_journal_rearm.rs | 3 +- .../src/qwen_dispatch/admission.rs | 5 ++- crates/cuda-driver/src/qwen_dispatch/cache.rs | 3 +- .../cuda-driver/src/qwen_dispatch/context.rs | 8 +++- .../context/context_gr_gate_mean_inject.rs | 3 +- .../context/gdn_ple_fixed_kernels.rs | 3 +- .../qwen_dispatch/context/gdn_step_kernels.rs | 6 ++- .../qwen_dispatch/context/gr_read_chain.rs | 6 ++- .../context/mtp_dense_attention.rs | 6 ++- .../context/mtp_fixed_kernels.rs | 2 +- .../context/qsa_fixed_kernels.rs | 3 +- .../src/qwen_dispatch/fixed_operands.rs | 2 +- .../src/qwen_dispatch/prepare_gr_read_set.rs | 4 +- .../tests/full_s2_bank_extent.rs | 3 +- .../tests/moe_new_preflight_requires_exact.rs | 6 ++- .../tests/qsa_new_slots_keep_atomic.rs | 5 ++- .../tests/qwen_actual_owner_poison_missing.rs | 3 +- .../qwen_attempted_launch_always_syncs.rs | 6 ++- crates/cuda-driver/src/qwen_ffi/asset.rs | 7 ++- .../asset_validation_and_bf16_layout.rs | 6 ++- .../src/qwen_ffi/bf16_receipt_types.rs | 3 +- crates/cuda-driver/src/qwen_ffi/mock_asset.rs | 5 ++- .../src/qwen_ffi/mtp_extended_assets_types.rs | 3 +- .../src/qwen_ffi/mtp_s2_full_layout.rs | 3 +- crates/cuda-driver/src/qwen_ffi/n_types.rs | 3 +- crates/cuda-driver/src/qwen_ffi/operation.rs | 6 ++- .../qwen_ffi/qsa_attention_receipt_types.rs | 3 +- crates/cuda-driver/src/qwen_ffi/qsa_layout.rs | 3 +- .../qwen_ffi/tests/full_s2_expert_scalar.rs | 6 ++- .../tests/moe_fixed_pointer_abi_extents.rs | 3 +- .../tests/mtp_new_qualified_assets.rs | 3 +- .../tests/qsa_new_literal_abi_scalar.rs | 3 +- crates/cuda-driver/src/qwen_shared_tail.rs | 5 ++- .../shared_expert_workspace.rs | 8 +++- .../shared_expert_workspace_append_close.rs | 6 ++- .../shared_expert_workspace_bring_up.rs | 6 ++- .../shared_expert_workspace_compose.rs | 2 +- .../shared_expert_workspace/shared_phases.rs | 7 ++- .../shared_expert_workspace_drop.rs | 6 ++- .../src/qwen_shared_tail/shared_gu_kind.rs | 5 ++- .../src/qwen_shared_tail_gpu/guard_probe.rs | 7 ++- .../src/qwen_shared_tail_gpu/original.rs | 7 ++- .../src/qwen_shared_tail_gpu/read.rs | 6 ++- .../src/routed_columns_loan_gpu/loan_cases.rs | 7 ++- .../cuda-driver/src/routed_group_workspace.rs | 7 ++- .../src/routed_group_workspace/context.rs | 7 ++- .../routed_group_down_projection.rs | 7 ++- .../routed_group_workspace_gpu/down_case.rs | 6 ++- .../src/routed_group_workspace_gpu/gu_case.rs | 6 ++- .../cuda-driver/src/routed_resident_queue.rs | 7 ++- .../routed_resident_queue/compose_phases.rs | 7 ++- .../routed_resident_completion.rs | 6 ++- .../routed_resident_queue_drop.rs | 3 +- .../routed_resident_queue_operations.rs | 5 ++- .../routed_resident_queue_gpu/queue_cases.rs | 7 ++- .../src/routed_resident_queue_gpu/run.rs | 3 +- .../src/routed_resident_queue_gpu/upload.rs | 6 ++- .../src/routed_stage_finite_guard.rs | 4 +- scripts/dev/explicit_imports.py | 43 ++++++++++++++----- 649 files changed, 2402 insertions(+), 1204 deletions(-) diff --git a/crates/cuda-driver/src/api/async_api.rs b/crates/cuda-driver/src/api/async_api.rs index d1358d32..861c24d6 100644 --- a/crates/cuda-driver/src/api/async_api.rs +++ b/crates/cuda-driver/src/api/async_api.rs @@ -1,9 +1,6 @@ //! Methods of `AsyncApi`: `load`, `create_stream`, `create_event`, `register` and 12 more. //! Methods of `MappedApi`: `load`, `register_bank`, `bank_alias`, `unregister_bank` and 12 more. -#[allow(unused_imports)] -use super::*; - #[cfg(not(all( feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), diff --git a/crates/cuda-driver/src/api/driver_backed.rs b/crates/cuda-driver/src/api/driver_backed.rs index 30029edf..a1a76ab1 100644 --- a/crates/cuda-driver/src/api/driver_backed.rs +++ b/crates/cuda-driver/src/api/driver_backed.rs @@ -3,7 +3,7 @@ //! Built only with the `cuda-driver` feature on 64-bit Linux and Windows; `api.rs` declares stub types for every other //! build. -use super::*; +use super::{Error, Event, MappedCopyArguments, Result, Stream}; use libc::{c_int, c_uint, c_void}; type Create = unsafe extern "C" fn(*mut *mut c_void, c_uint) -> c_int; type Destroy = unsafe extern "C" fn(*mut c_void) -> c_int; diff --git a/crates/cuda-driver/src/api/driver_backed/batch_copy.rs b/crates/cuda-driver/src/api/driver_backed/batch_copy.rs index 63a08832..20c826e5 100644 --- a/crates/cuda-driver/src/api/driver_backed/batch_copy.rs +++ b/crates/cuda-driver/src/api/driver_backed/batch_copy.rs @@ -1,6 +1,6 @@ //! The optional batch-copy entry of `AsyncApi` (the lent-slot refill's `LELEKA_REFILL_BATCH`): resolved only when the //! driver exports both symbols; a missing one leaves the per-copy path. -use super::*; +use super::{AsyncApi, Error, Event, Library, Result, Stream, c_int, c_uint, c_void, check}; use crate::refill_batch_copy::BatchCall; /// `cuMemcpyBatchAsync_v2` (CUDA 12.8+/13, the form without `failIdx`): dsts, srcs, sizes, count, attrs, attrsIdxs, diff --git a/crates/cuda-driver/src/arch_ptx/stream_k_off.rs b/crates/cuda-driver/src/arch_ptx/stream_k_off.rs index afd53bad..f0346c87 100644 --- a/crates/cuda-driver/src/arch_ptx/stream_k_off.rs +++ b/crates/cuda-driver/src/arch_ptx/stream_k_off.rs @@ -1,8 +1,9 @@ //! Functions: `stream_k_off`, `marker_files_present`, `forced_sms`, `chunk_drain` and 10 more. //! Split out of `arch_ptx` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::STREAM_K_AVOIDED; +#[cfg(feature = "sm86")] +use super::imp; /// STRA-235: the grouped / MTP / resident MMQ launch one block per tile instead of the stream-K grid of `sms` blocks /// (no split of the K loop, no fixup kernel). On by default for an sm_86-class device (latched by diff --git a/crates/cuda-driver/src/batch_gr_preview.rs b/crates/cuda-driver/src/batch_gr_preview.rs index 1997c4a1..13cebb44 100644 --- a/crates/cuda-driver/src/batch_gr_preview.rs +++ b/crates/cuda-driver/src/batch_gr_preview.rs @@ -1,6 +1,9 @@ //! First real chunk primitive: one launch over independent GR token columns. //! Numerical experiment only; no production asset admission or session commit. -use super::*; +use super::{Context, DeviceBuffer, Error, Operation, Result, qwen_ffi}; +// used only with some cargo features or targets of this crate +#[allow(unused_imports)] +use super::{Arguments, Backend, combine, ffi, ranges_layout}; /// The four device buffers of one batched residual-inject launch. pub struct GrInjectBuffers<'a, 'b> { pub residual: &'a DeviceBuffer<'b>, diff --git a/crates/cuda-driver/src/bringup_trace_enabled.rs b/crates/cuda-driver/src/bringup_trace_enabled.rs index b34af2e3..cbd4aaac 100644 --- a/crates/cuda-driver/src/bringup_trace_enabled.rs +++ b/crates/cuda-driver/src/bringup_trace_enabled.rs @@ -1,8 +1,9 @@ //! Methods of `PromptSyncTrace`: `enter`. Methods of `Driver`: `load`, `version`, `device`. //! Implements `Drop for PromptSyncTrace`, `Drop for RoutedGateUpQ8`. Functions: `combine`, `valid_size`. -#[allow(unused_imports)] -use super::*; +use super::{ + Cell, Context, Device, Driver, Error, PoisonCell, PromptSyncTrace, Rc, Result, RoutedGateUpQ8, ffi, qwen_dispatch, +}; impl PromptSyncTrace { pub fn enter() -> Self { diff --git a/crates/cuda-driver/src/closed_kernels/program.rs b/crates/cuda-driver/src/closed_kernels/program.rs index 38845451..d8ae7e20 100644 --- a/crates/cuda-driver/src/closed_kernels/program.rs +++ b/crates/cuda-driver/src/closed_kernels/program.rs @@ -1,8 +1,11 @@ //! Methods of `Program`: `name`, `ptx`, `pin`, `source` and 1 more. Methods of `Slot`: `kind`. //! Functions: `admit_ptx`, `admit`, `s_gemv_entry_index`, `conforms` and 5 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, DEVICE_POISON_PTX, Entry, ExperimentalError, FLASH_ENTRIES, FlashBytes, Kernel, MAX_ENTRY_ARGUMENTS, + NATIVE_FLASH_ATTN_PTX, PINS, POISON_ENTRIES, Program, PtxPin, Result, Role, S_GEMV_ENTRIES, S_GEMV_LEGACY_PTX, + SBytes, SForm, Slot, flash, invalid, qwen_ffi, +}; impl Program { pub const ALL: [Program; 3] = [Program::NativeFlashAttn, Program::SGemvLegacy, Program::DevicePoison]; diff --git a/crates/cuda-driver/src/closed_kernels/s_gemv_slots.rs b/crates/cuda-driver/src/closed_kernels/s_gemv_slots.rs index e44ff255..3efdfc7f 100644 --- a/crates/cuda-driver/src/closed_kernels/s_gemv_slots.rs +++ b/crates/cuda-driver/src/closed_kernels/s_gemv_slots.rs @@ -1,8 +1,7 @@ //! Functions: `s_gemv_slots`, `head_slots`. //! Split out of `closed_kernels` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Kernel, Plan, Role, SForm, Slot}; /// The kernel arguments of a planned S-form GEMV, in the entry's order. `offset_present` is `offset != nullptr`. pub fn s_gemv_slots(plan: &Plan, form: &SForm, n_in: i64, n_out: i64, offset_present: bool) -> Vec { diff --git a/crates/cuda-driver/src/closed_kernels/tests/flash_and_poison_signatures_match.rs b/crates/cuda-driver/src/closed_kernels/tests/flash_and_poison_signatures_match.rs index 83301584..18b8ca21 100644 --- a/crates/cuda-driver/src/closed_kernels/tests/flash_and_poison_signatures_match.rs +++ b/crates/cuda-driver/src/closed_kernels/tests/flash_and_poison_signatures_match.rs @@ -2,8 +2,11 @@ //! flash_and_poison_signatures_match_their_cuda_source, s_gemv_signatures_match_their_cuda_source, //! index_constants_and_planners_point_at_the_named_entries, every_planned_launch_conforms_to_its_entry .... -#[allow(unused_imports)] -use super::*; +use super::{ + FLASH_ENTRIES, FLASH_SHORT, Kernel, MAX_ENTRY_ARGUMENTS, POISON_ENTRIES, POISON_F32, Plan, Program, Role, + S_GEMV_ENTRIES, SForm, Slot, arg_kinds, conforms, flash, flash_bytes, flash_slots, kinds_in, macro_kinds, + poison_slots, s_gemv_entry_index, s_gemv_slots, s_operand_bytes, sg, +}; #[test] fn flash_and_poison_signatures_match_their_cuda_source() { diff --git a/crates/cuda-driver/src/closed_kernels/tests/sealed_assets_match_their_pins.rs b/crates/cuda-driver/src/closed_kernels/tests/sealed_assets_match_their_pins.rs index 0d787251..e2c97e7a 100644 --- a/crates/cuda-driver/src/closed_kernels/tests/sealed_assets_match_their_pins.rs +++ b/crates/cuda-driver/src/closed_kernels/tests/sealed_assets_match_their_pins.rs @@ -1,8 +1,7 @@ //! Tests of tests by topic (moved out of the test file by STRA-338): //! sealed_assets_match_their_pins_and_export_every_entry. -#[allow(unused_imports)] -use super::*; +use super::{ExperimentalError, Program, PtxPin, admit, admit_ptx, qwen_ffi}; fn assert_pin_is_the_sealed_ptx(program: Program) { use crate::sealed_ptx::test_support::{assert_nvcc_13_2_86, assert_real_sm120_ptx}; diff --git a/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels.rs b/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels.rs index d5840264..5bd08248 100644 --- a/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels.rs +++ b/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels.rs @@ -1,8 +1,12 @@ //! Groups the submodules `closed_kernels_flash_and_s_gemv`, `closed_kernels_open_admit_run`. //! Split out of `closed_kernels_gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Admitted, ClosedKernels, Context, DeviceBuffer, DriverResult, Error, ExperimentalError, FLASH_SHORT, + FlashStepBuffers, Geometry, Launch, Operand, POISON_F32, Plan, Program, Rc, Result, Role, SForm, SGemvBuffers, + SGemvDims, Slot, admit, combine, conforms, device_arena, failure, ffi, flash, flash_bytes, flash_slots, invalid, + poison_slots, s_gemv_entry_index, s_gemv_slots, s_operand_bytes, +}; mod closed_kernels_flash_and_s_gemv; mod closed_kernels_open_admit_run; diff --git a/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels/closed_kernels_flash_and_s_gemv.rs b/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels/closed_kernels_flash_and_s_gemv.rs index 52ef4030..b5ef1a45 100644 --- a/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels/closed_kernels_flash_and_s_gemv.rs +++ b/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels/closed_kernels_flash_and_s_gemv.rs @@ -1,8 +1,11 @@ //! Methods of `FlashBuffers`: `admit`, `operands`. //! Methods of `ClosedKernels`: `native_flash_attn_short`, `poison_f32`, `s_gemv`, `s2_gemv`. -#[allow(unused_imports)] -use super::*; +use super::{ + ClosedKernels, DeviceBuffer, Error, ExperimentalError, FLASH_SHORT, FlashStepBuffers, Geometry, Operand, + POISON_F32, Plan, Program, Result, Role, SForm, SGemvBuffers, SGemvDims, device_arena, flash, flash_bytes, + flash_slots, invalid, poison_slots, s_gemv_entry_index, s_gemv_slots, s_operand_bytes, +}; use crate::closed_kernels::FlashBytes; diff --git a/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels/closed_kernels_open_admit_run.rs b/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels/closed_kernels_open_admit_run.rs index 70261608..cea0c28e 100644 --- a/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels/closed_kernels_open_admit_run.rs +++ b/crates/cuda-driver/src/closed_kernels_gpu/closed_kernels/closed_kernels_open_admit_run.rs @@ -1,8 +1,10 @@ //! Methods of `ClosedKernels`: `open`, `close`, `expect`, `build` and 4 more. //! Functions: `resolve_functions`, `reject_aliasing`. -#[allow(unused_imports)] -use super::*; +use super::{ + Admitted, ClosedKernels, Context, DriverResult, Error, Geometry, Launch, Operand, Program, Rc, Result, Role, Slot, + admit, combine, conforms, failure, ffi, invalid, +}; /// Resolves every entry of the program in order; the first failure is returned and nothing is kept. fn resolve_functions( diff --git a/crates/cuda-driver/src/closed_kernels_gpu/failure.rs b/crates/cuda-driver/src/closed_kernels_gpu/failure.rs index e5d7a66e..8d846875 100644 --- a/crates/cuda-driver/src/closed_kernels_gpu/failure.rs +++ b/crates/cuda-driver/src/closed_kernels_gpu/failure.rs @@ -1,8 +1,7 @@ //! Functions: `failure`. //! Split out of `closed_kernels_gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{DriverResult, Error, ExperimentalError, combine}; /// A primary driver failure plus the outcome of the mandatory context restore. pub(super) fn failure(primary: Error, restore: DriverResult<()>) -> ExperimentalError { diff --git a/crates/cuda-driver/src/closed_kernels_gpu_smoke/cases.rs b/crates/cuda-driver/src/closed_kernels_gpu_smoke/cases.rs index 077ae550..bfbb8f34 100644 --- a/crates/cuda-driver/src/closed_kernels_gpu_smoke/cases.rs +++ b/crates/cuda-driver/src/closed_kernels_gpu_smoke/cases.rs @@ -1,7 +1,9 @@ //! The cases of the closed-program smokes: one short FlashAttention case and one replayed S-form GEMV golden case. -#[allow(unused_imports)] -use super::*; +use super::{ + ClosedKernels, Codebook, Context, DeviceBuffer, FlashStepBuffers, Kernel, Rng, SForm, SGemvBuffers, SGemvDims, + download, f16_bits, f32s, flash, json_bytes, json_f32, sg, upload, zero_kv, +}; const CAPACITY: usize = 256; diff --git a/crates/cuda-driver/src/closed_kernels_gpu_smoke/rng.rs b/crates/cuda-driver/src/closed_kernels_gpu_smoke/rng.rs index fdc61c41..813fd76a 100644 --- a/crates/cuda-driver/src/closed_kernels_gpu_smoke/rng.rs +++ b/crates/cuda-driver/src/closed_kernels_gpu_smoke/rng.rs @@ -1,8 +1,7 @@ //! Methods of `Rng`: `next`, `normal`. Functions: `f16_bits`, `upload`, `download`, `f32s` and 4 more. //! Split out of `closed_kernels_gpu_smoke` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ClosedKernels, Context, DeviceBuffer, Program, Rng}; impl Rng { pub(super) fn next(&mut self) -> u32 { diff --git a/crates/cuda-driver/src/context.rs b/crates/cuda-driver/src/context.rs index ca7d1b28..dffa6c88 100644 --- a/crates/cuda-driver/src/context.rs +++ b/crates/cuda-driver/src/context.rs @@ -1,8 +1,10 @@ //! Methods of `Context`: `poison`, `retain_driver`, `budget_bytes`, `device_ordinal` and 16 more. //! Split out of `crate` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, CurrentGuard, DeviceBuffer, Error, FixedOperation, PhantomData, Rc, Result, combine, ffi, valid_size, + vector_shape, vram_ledger, +}; impl Context<'_> { /// Private sticky failure primitive shared by native owners. diff --git a/crates/cuda-driver/src/context_gate_up_projection_admission.rs b/crates/cuda-driver/src/context_gate_up_projection_admission.rs index 598c5d61..9a3ef115 100644 --- a/crates/cuda-driver/src/context_gate_up_projection_admission.rs +++ b/crates/cuda-driver/src/context_gate_up_projection_admission.rs @@ -1,8 +1,11 @@ //! Methods of `Context`: `project_routed_gate_up_prepared_weight`, `prepared_scratch`, `gate_up_prepared_shape`, `ga... //! Split out of `crate` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, NativeWeights, ProjectionKind, ProjectionShape, ProjectionSpec, Q5KProjectionShape, + Q5KShape, Q6KProjectionShape, Q6KShape, Result, RoutedFormat, RoutedGateUpQ8, combine, ffi, projection_ranges, + projection_shape, q5_k_shape, q6_k_shape, +}; impl Context<'_> { pub(super) fn project_routed_gate_up_prepared_weight( diff --git a/crates/cuda-driver/src/context_matvec_k_quant_projections.rs b/crates/cuda-driver/src/context_matvec_k_quant_projections.rs index 18ad0faf..aa3586b2 100644 --- a/crates/cuda-driver/src/context_matvec_k_quant_projections.rs +++ b/crates/cuda-driver/src/context_matvec_k_quant_projections.rs @@ -1,8 +1,10 @@ //! Methods of `Context`: `matvec_f32`, `q5_k_q8_1`, `q5_k_operation`, `q6_k_q8_1` and 4 more. Defines `MatvecDims`. //! Split out of `crate` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, FixedOperation, NativeWeights, ProjectionSpec, Q5KProjectionShape, Q5KShape, + Q6KProjectionShape, Q6KShape, Result, combine, ffi, +}; /// The row and column counts of a matrix-vector product. #[derive(Clone, Copy, Debug, PartialEq, Eq)] diff --git a/crates/cuda-driver/src/context_projection_kernel_slots.rs b/crates/cuda-driver/src/context_projection_kernel_slots.rs index b41f9df2..90cba01a 100644 --- a/crates/cuda-driver/src/context_projection_kernel_slots.rs +++ b/crates/cuda-driver/src/context_projection_kernel_slots.rs @@ -1,8 +1,10 @@ //! Methods of `Context`: `matvec_admission`, `kernel_slot`, `kernel_slot_rest`, `fixed_kernel` and 10 more. //! Split out of `crate` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Cell, Context, DeviceBuffer, Error, FixedKernel, FixedOperation, FixedPairKernels, MatvecShape, ProjectionKernels, + ProjectionKind, Rc, Result, combine, ffi, matvec_allocations, matvec_shape, +}; impl Context<'_> { pub(super) fn matvec_admission( diff --git a/crates/cuda-driver/src/context_q8_1_and_gate_up_projection.rs b/crates/cuda-driver/src/context_q8_1_and_gate_up_projection.rs index d11f2123..eecabaa0 100644 --- a/crates/cuda-driver/src/context_q8_1_and_gate_up_projection.rs +++ b/crates/cuda-driver/src/context_q8_1_and_gate_up_projection.rs @@ -1,8 +1,10 @@ //! Methods of `Context`: `project_q8_1_weight`, `project_q8_1_operation`, `prepare_routed_gate_up_q8`, `gate_up_sour... //! Split out of `crate` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, FixedOperation, NativeWeights, ProjectionShape, ProjectionSpec, Result, RoutedFormat, + RoutedGateUpQ8, combine, ffi, +}; impl Context<'_> { pub(super) fn project_q8_1_weight( diff --git a/crates/cuda-driver/src/context_unload_close_destroy.rs b/crates/cuda-driver/src/context_unload_close_destroy.rs index 9912422d..cd84a737 100644 --- a/crates/cuda-driver/src/context_unload_close_destroy.rs +++ b/crates/cuda-driver/src/context_unload_close_destroy.rs @@ -1,8 +1,7 @@ //! Methods of `Context`: `unload_projections`, `unload_projection_slot`, `unload_q5_kernels`, `unload_q6_kernels` an... //! Methods of `CurrentGuard`: `finish`, `restore`. Implements `Drop for Context`, `Drop for CurrentGuard`. -#[allow(unused_imports)] -use super::*; +use super::{Context, CurrentGuard, Error, FixedOperation, ProjectionKernels, Rc, Result, combine}; impl Context<'_> { pub(super) fn unload_projections(&self) -> Result<()> { diff --git a/crates/cuda-driver/src/device_buffer.rs b/crates/cuda-driver/src/device_buffer.rs index a44f32e7..3cf1eb4e 100644 --- a/crates/cuda-driver/src/device_buffer.rs +++ b/crates/cuda-driver/src/device_buffer.rs @@ -1,8 +1,9 @@ //! Methods of `DeviceBuffer`: `len`, `is_empty`, `staging`, `copy_from` and 12 more. //! Implements `Drop for DeviceBuffer`. Functions: `chain_selects_mtp`, `chain_selects_mtp`, `set_chain_down_override`. -#[allow(unused_imports)] -use super::*; +use super::{DeviceBuffer, Error, Result, combine, compute_drain, vram_ledger}; +#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))] +use super::original_verify; impl DeviceBuffer<'_> { pub fn len(&self) -> usize { diff --git a/crates/cuda-driver/src/experimental/kv_shape.rs b/crates/cuda-driver/src/experimental/kv_shape.rs index 1fed63f6..3da6dedf 100644 --- a/crates/cuda-driver/src/experimental/kv_shape.rs +++ b/crates/cuda-driver/src/experimental/kv_shape.rs @@ -1,8 +1,10 @@ //! Methods of `KvShape`: `real`, `as_qsa`, `base`, `check_q4` and 8 more. Methods of `Context`: `unload_experimental`. //! Functions: `fwht_grid`, `fwht_bytes`, `q4_step_grid`, `q4_batch_grid` and 12 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, ExperimentalError, Grid, KvShape, MAX_GRID_YZ, QsaShapes, Result, cvec, grid_x, grid_yz, invalid, keyless, + kv_q8, q4_0, +}; impl KvShape { pub const fn real() -> Self { diff --git a/crates/cuda-driver/src/experimental/mode.rs b/crates/cuda-driver/src/experimental/mode.rs index 00468210..5d686f86 100644 --- a/crates/cuda-driver/src/experimental/mode.rs +++ b/crates/cuda-driver/src/experimental/mode.rs @@ -1,8 +1,11 @@ //! Methods of `Mode`: `name`, `bit`. Methods of `OptIn`: `with`, `is_enabled`, `is_empty`, `modes` and 2 more. //! Implements `Display for ExperimentalError`, `Error for ExperimentalError` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{ + CVEC_ENTRIES, CVEC_PTX, Entry, Error, ExperimentalError, KEYLESS_ENTRIES, KEYLESS_PTX, KV_Q4_ENTRIES, KV_Q4_PTX, + KV_Q8_ENTRIES, KV_Q8_PTX, KV_STREAM_ENTRIES, KV_STREAM_PTX, MAX_GRID_X, MAX_GRID_YZ, Mode, OptIn, PINS, Program, + PtxPin, QSA_ATTN_ENTRIES, QSA_ATTN_PTX, Result, fmt, qwen_ffi, +}; impl Mode { pub const ALL: [Mode; 6] = diff --git a/crates/cuda-driver/src/experimental_gpu/context.rs b/crates/cuda-driver/src/experimental_gpu/context.rs index 3fe06342..7899d9c2 100644 --- a/crates/cuda-driver/src/experimental_gpu/context.rs +++ b/crates/cuda-driver/src/experimental_gpu/context.rs @@ -1,8 +1,9 @@ //! Methods of `Context`: `experimental_program`, `unload_failed`. Functions: `resolve_entries`, `i32_of`, `i64_of`. //! Split out of `experimental_gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DriverResult, Error, LoadedProgram, OptIn, Program, Rc, Result, admit, combine, failure, ffi, invalid, +}; impl Context<'_> { /// Opt-in and pin gates, then load and cache the module once. Refuses without touching the driver while the diff --git a/crates/cuda-driver/src/experimental_gpu/facade_launches.rs b/crates/cuda-driver/src/experimental_gpu/facade_launches.rs index 63733599..fe5561fb 100644 --- a/crates/cuda-driver/src/experimental_gpu/facade_launches.rs +++ b/crates/cuda-driver/src/experimental_gpu/facade_launches.rs @@ -1,7 +1,13 @@ //! The launch methods of the `Experimental` facade, one module per program family. -#[allow(unused_imports)] -use super::*; +use super::{ + ATTN_CHUNK_M2, ATTN_CHUNK_M3, ATTN_CHUNK_M4, ATTN_MERGE, AttendDestination, AttendKv, AttnPools, BatchRows, + COPY_U4, CTL_INTS, CVEC_APPLY, Call, CellSelection, Context, ControlVector, CvecDims, DeviceBuffer, Error, + Experimental, FWHT256, GatherIndex, KEYLESS_ROUTE, KvPair, KvShape, Launch, OptIn, PageStep, Paged, Program, + Q4_APPEND_BATCH, Q4_APPEND_STEP, Q4_GATHER_STEP, Q8_APPEND_STEP, Q8_GATHER_STEP, Q8Pool, Q8PoolAppend, QueryBatch, + RING_TABLE, ResolveDims, ResolveGeometry, ResolveIndex, Result, STEP_BYTES, STREAM_COPY, STREAM_RESET, + STREAM_RESOLVE, StreamArrays, StreamDims, StreamMap, attn, experimental, i32_of, i64_of, invalid, stream_runs, +}; mod attention_launch; mod program_and_kv_pool_launches; diff --git a/crates/cuda-driver/src/experimental_gpu/facade_launches/attention_launch.rs b/crates/cuda-driver/src/experimental_gpu/facade_launches/attention_launch.rs index aca970d5..da1ba204 100644 --- a/crates/cuda-driver/src/experimental_gpu/facade_launches/attention_launch.rs +++ b/crates/cuda-driver/src/experimental_gpu/facade_launches/attention_launch.rs @@ -1,7 +1,10 @@ //! The attention launch of the experimental KV modes: the chunk kernel of the pool mode, then the merge. -#[allow(unused_imports)] -use super::*; +use super::{ + ATTN_CHUNK_M2, ATTN_CHUNK_M3, ATTN_CHUNK_M4, ATTN_MERGE, AttendDestination, AttendKv, AttnPools, Call, + CellSelection, DeviceBuffer, Experimental, Paged, Program, QueryBatch, Result, STEP_BYTES, attn, experimental, + i32_of, i64_of, +}; mod attend_inputs; use attend_inputs::Attend; diff --git a/crates/cuda-driver/src/experimental_gpu/facade_launches/attention_launch/attend_inputs.rs b/crates/cuda-driver/src/experimental_gpu/facade_launches/attention_launch/attend_inputs.rs index ea6edb38..d62bd082 100644 --- a/crates/cuda-driver/src/experimental_gpu/facade_launches/attention_launch/attend_inputs.rs +++ b/crates/cuda-driver/src/experimental_gpu/facade_launches/attention_launch/attend_inputs.rs @@ -1,7 +1,9 @@ //! The inputs and derived sizes shared by the chunk and merge launches of `Experimental::attend`. -#[allow(unused_imports)] -use super::*; +use super::{ + ATTN_CHUNK_M2, ATTN_CHUNK_M3, ATTN_CHUNK_M4, ATTN_MERGE, AttnPools, Call, DeviceBuffer, Experimental, Paged, + Result, STEP_BYTES, attn, experimental, i32_of, i64_of, +}; /// The inputs and the derived sizes of one `attend`. pub(super) struct Attend<'a, 'b> { diff --git a/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches.rs b/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches.rs index da125499..400b9378 100644 --- a/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches.rs +++ b/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches.rs @@ -1,7 +1,10 @@ //! Opening the program, the call builder entry, the FWHT launch and the Q4_0 / INT8 pool append and gather launches. -#[allow(unused_imports)] -use super::*; +use super::{ + BatchRows, Call, Context, DeviceBuffer, Error, Experimental, FWHT256, GatherIndex, KvPair, KvShape, Launch, OptIn, + PageStep, Paged, Program, Q4_APPEND_BATCH, Q4_APPEND_STEP, Q4_GATHER_STEP, Q8_APPEND_STEP, Q8PoolAppend, Result, + STEP_BYTES, experimental, i64_of, invalid, +}; mod call_shape; mod step_operands; diff --git a/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches/call_shape.rs b/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches/call_shape.rs index 7d645d72..9b3f9ac3 100644 --- a/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches/call_shape.rs +++ b/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches/call_shape.rs @@ -1,7 +1,6 @@ //! Argument groups that the experimental KV launches repeat: the page-shape scalars and runs of null pointers. -#[allow(unused_imports)] -use super::*; +use super::{Call, KvShape}; impl<'g, 'c> Call<'g, 'c> { /// `kv_heads`, `head_dim` and `page_size` of the pool shape, as three i32 scalars. diff --git a/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches/step_operands.rs b/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches/step_operands.rs index b887b5fc..c626bf71 100644 --- a/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches/step_operands.rs +++ b/crates/cuda-driver/src/experimental_gpu/facade_launches/program_and_kv_pool_launches/step_operands.rs @@ -1,8 +1,7 @@ //! The operands of the Q4 batch append, the Q4 gather and the INT8 step append, bundled so that each launch chain //! lives in a method of its own. -#[allow(unused_imports)] -use super::*; +use super::{Call, DeviceBuffer, Experimental, Launch, Paged, Q4_APPEND_BATCH, Q4_GATHER_STEP, Result, STEP_BYTES}; /// The operands of one `kv_append_q4` (prefill) launch pair; `launch` builds the K (`is_v` 0) or V (`is_v` 1) pass. pub(super) struct Q4Batch<'a, 'b> { diff --git a/crates/cuda-driver/src/experimental_gpu/facade_launches/stream_keyless_cvec_launches.rs b/crates/cuda-driver/src/experimental_gpu/facade_launches/stream_keyless_cvec_launches.rs index c7487864..6f6c7224 100644 --- a/crates/cuda-driver/src/experimental_gpu/facade_launches/stream_keyless_cvec_launches.rs +++ b/crates/cuda-driver/src/experimental_gpu/facade_launches/stream_keyless_cvec_launches.rs @@ -1,7 +1,11 @@ //! The INT8 gather, KV streaming (reset, resolve, ring restore), keyless routing and control-vector launches. -#[allow(unused_imports)] -use super::*; +use super::{ + COPY_U4, CTL_INTS, CVEC_APPLY, Call, ControlVector, CvecDims, DeviceBuffer, Experimental, GatherIndex, + KEYLESS_ROUTE, KvPair, Launch, Paged, Program, Q8_GATHER_STEP, Q8Pool, RING_TABLE, ResolveDims, ResolveGeometry, + ResolveIndex, Result, STEP_BYTES, STREAM_COPY, STREAM_RESET, STREAM_RESOLVE, StreamArrays, StreamDims, StreamMap, + experimental, i32_of, i64_of, invalid, stream_runs, +}; mod q8_gather_and_resolve_launch; use q8_gather_and_resolve_launch::Q8Gather; diff --git a/crates/cuda-driver/src/experimental_gpu/facade_launches/stream_keyless_cvec_launches/q8_gather_and_resolve_launch.rs b/crates/cuda-driver/src/experimental_gpu/facade_launches/stream_keyless_cvec_launches/q8_gather_and_resolve_launch.rs index f000993a..2f0c9941 100644 --- a/crates/cuda-driver/src/experimental_gpu/facade_launches/stream_keyless_cvec_launches/q8_gather_and_resolve_launch.rs +++ b/crates/cuda-driver/src/experimental_gpu/facade_launches/stream_keyless_cvec_launches/q8_gather_and_resolve_launch.rs @@ -1,8 +1,10 @@ //! The operands of the INT8 gather and the launch of the KV-stream resolve, bundled so that each launch chain lives //! in a method of its own. -#[allow(unused_imports)] -use super::*; +use super::{ + Call, DeviceBuffer, Experimental, Launch, Paged, Q8_GATHER_STEP, ResolveDims, ResolveGeometry, Result, STEP_BYTES, + STREAM_RESOLVE, StreamDims, StreamMap, experimental, i32_of, i64_of, +}; /// The operands of one `kv_gather_q8_step` launch. pub(super) struct Q8Gather<'a, 'b> { diff --git a/crates/cuda-driver/src/experimental_gpu/operands.rs b/crates/cuda-driver/src/experimental_gpu/operands.rs index 7120a901..a1788e4e 100644 --- a/crates/cuda-driver/src/experimental_gpu/operands.rs +++ b/crates/cuda-driver/src/experimental_gpu/operands.rs @@ -1,8 +1,7 @@ //! The domain groups of the public `Experimental` launches (K/V pairs, page-table and step records, gather indexes, //! streaming geometry, control-vector and attention operands), so that no facade call takes more than five parameters. -#[allow(unused_imports)] -use super::*; +use super::{AttnPools, DeviceBuffer, KvShape, Paged, StreamFormat}; /// The K and V counterparts of one kind of operand (pools, current rows, scratch arrays). pub struct KvPair { diff --git a/crates/cuda-driver/src/experimental_gpu/stream_map.rs b/crates/cuda-driver/src/experimental_gpu/stream_map.rs index 917fcacd..74e2b765 100644 --- a/crates/cuda-driver/src/experimental_gpu/stream_map.rs +++ b/crates/cuda-driver/src/experimental_gpu/stream_map.rs @@ -1,8 +1,10 @@ //! Methods of `StreamMap`: `bind`. Methods of `Call`: `pointer`, `ro`, `rw`, `ro_at` and 7 more. Functions: `failure`. //! Split out of `experimental_gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Admitted, Arg, CTL_INTS, Call, DeviceBuffer, DriverResult, Entry, Error, ExperimentalError, Launch, Result, + StreamMap, combine, ffi, invalid, +}; impl StreamMap<'_, '_> { /// The first five (or seven, for resolve) pointer arguments of `reset` / `resolve`. diff --git a/crates/cuda-driver/src/ffi/api.rs b/crates/cuda-driver/src/ffi/api.rs index c0520041..be7e0cf6 100644 --- a/crates/cuda-driver/src/ffi/api.rs +++ b/crates/cuda-driver/src/ffi/api.rs @@ -1,9 +1,6 @@ //! Methods of `Api`: `memory_info`, `mmq_capabilities`, `load_mmq`, `mmq_function` and 56 more. //! Split out of `ffi` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; - #[cfg(not(all( feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), diff --git a/crates/cuda-driver/src/ffi/context_handle.rs b/crates/cuda-driver/src/ffi/context_handle.rs index 3a082487..13d66dfe 100644 --- a/crates/cuda-driver/src/ffi/context_handle.rs +++ b/crates/cuda-driver/src/ffi/context_handle.rs @@ -1,8 +1,10 @@ //! Methods of `ContextHandle`: `synthetic`. //! Methods of `BufferHandle`: `registered_bank_alias`, `checked_subspan`, `qwen_address`, `validate_extent` and 7 more. +use super::{BufferHandle, DenseFormat, Error, ProjectionKind, Result, RoutedFormat}; +// used only with some cargo features or targets of this crate #[allow(unused_imports)] -use super::*; +use super::ModuleHandle; #[cfg(all( test, diff --git a/crates/cuda-driver/src/ffi/driver_backed.rs b/crates/cuda-driver/src/ffi/driver_backed.rs index a1bbc3d6..28c14400 100644 --- a/crates/cuda-driver/src/ffi/driver_backed.rs +++ b/crates/cuda-driver/src/ffi/driver_backed.rs @@ -3,7 +3,13 @@ //! Built only with the `cuda-driver` feature on 64-bit Linux and Windows; `ffi.rs` declares stub types for every other //! build. -use super::*; +use super::{ + BufferHandle, ContextHandle, Error, FixedOperation, FunctionHandle, GdnPrefillArguments, GrReadGuardArguments, + HeadGreedyArguments, Iq3NativeIntegerArguments, LaunchArguments, MatvecArguments, MmqArguments, MmqFixupArguments, + MmqOriginalGatherArguments, MmqOriginalSwigluArguments, MmqQuantArguments, MmqResidentArguments, ModuleHandle, + ProjectionArguments, Q5ProjectionArguments, Q6ProjectionArguments, Q8QuantizeArguments, QsaSelectedArguments, + Result, projection_entry, projection_ptx, validate_projection_ptx, +}; use libc::{c_int, c_uint, c_void}; type CuResult = c_int; diff --git a/crates/cuda-driver/src/ffi/driver_backed/api.rs b/crates/cuda-driver/src/ffi/driver_backed/api.rs index 488a2e93..92aaef4b 100644 --- a/crates/cuda-driver/src/ffi/driver_backed/api.rs +++ b/crates/cuda-driver/src/ffi/driver_backed/api.rs @@ -1,8 +1,10 @@ //! Methods of `Api`: `memory_info`, `mmq_capabilities`, `load_mmq`, `mmq_function` and 9 more. //! Split out of `enabled` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, CuDevice, CuResult, Error, FunctionHandle, HeadGreedyArguments, Iq3NativeIntegerArguments, MemGetInfoV2, + ModuleHandle, Result, c_int, c_void, check, +}; impl Api { /// The dynamic shared-memory sizes an MMQ kernel may be raised to: a closed list. diff --git a/crates/cuda-driver/src/ffi/driver_backed/device_context_memory_copies.rs b/crates/cuda-driver/src/ffi/driver_backed/device_context_memory_copies.rs index df33006b..a78dce8a 100644 --- a/crates/cuda-driver/src/ffi/driver_backed/device_context_memory_copies.rs +++ b/crates/cuda-driver/src/ffi/driver_backed/device_context_memory_copies.rs @@ -1,8 +1,7 @@ //! Methods of `Api`: `device`, `create`, `destroy`, `push` and 11 more. //! Split out of `enabled` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Api, BufferHandle, ContextHandle, CuContext, Error, Result, c_void, check}; impl Api { pub(crate) fn device(&self, ordinal: i32) -> Result { diff --git a/crates/cuda-driver/src/ffi/driver_backed/library_drop.rs b/crates/cuda-driver/src/ffi/driver_backed/library_drop.rs index da8988f6..2b25d9c6 100644 --- a/crates/cuda-driver/src/ffi/driver_backed/library_drop.rs +++ b/crates/cuda-driver/src/ffi/driver_backed/library_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for Library`. Functions: `check`. //! Split out of `enabled` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{CuResult, Error, Library, Result}; impl Drop for Library { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/ffi/driver_backed/library_load_fixed_operations.rs b/crates/cuda-driver/src/ffi/driver_backed/library_load_fixed_operations.rs index 715b362b..40827deb 100644 --- a/crates/cuda-driver/src/ffi/driver_backed/library_load_fixed_operations.rs +++ b/crates/cuda-driver/src/ffi/driver_backed/library_load_fixed_operations.rs @@ -1,8 +1,14 @@ //! Methods of `Api`: `launch_qwen`, `load`, `resolve`, `load_q6_batch_preview` and 4 more. //! Functions: `is_projection_family`. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, COMMON_QUANTIZER_PTX, ContextCreateV2, ContextDestroyV2, ContextPopCurrentV2, ContextPushCurrentV2, + ContextSynchronize, DeviceGet, DriverGetVersion, Error, FIXED_PTX, FixedOperation, FunctionHandle, Init, + LaunchKernel, Library, MATVEC_PTX, MemAllocV2, MemFreeV2, MemcpyDtoDV2, MemcpyDtoHV2, MemcpyHtoDV2, MemsetD8V2, + ModuleGetFunction, ModuleHandle, ModuleLoadData, ModuleUnload, Q5_K_PTX, Q6_K_PTX, Q6ProjectionArguments, + Q8QuantizeArguments, Result, StreamSynchronizeRaw, c_void, check, projection_entry, projection_ptx, + validate_projection_ptx, +}; mod fixed_selectors; use fixed_selectors::{fixed_entry, fixed_ptx}; diff --git a/crates/cuda-driver/src/ffi/driver_backed/library_load_fixed_operations/fixed_selectors.rs b/crates/cuda-driver/src/ffi/driver_backed/library_load_fixed_operations/fixed_selectors.rs index 1bef8f0f..2141bc9e 100644 --- a/crates/cuda-driver/src/ffi/driver_backed/library_load_fixed_operations/fixed_selectors.rs +++ b/crates/cuda-driver/src/ffi/driver_backed/library_load_fixed_operations/fixed_selectors.rs @@ -1,7 +1,9 @@ //! The sealed PTX image and the C entry name of a fixed operation, one exhaustive match per group of operations. -#[allow(unused_imports)] -use super::*; +use super::{ + COMMON_QUANTIZER_PTX, Error, FIXED_PTX, FixedOperation, MATVEC_PTX, Q5_K_PTX, Q6_K_PTX, Result, projection_entry, + projection_ptx, +}; /// The sealed PTX image of a fixed operation. pub(super) fn fixed_ptx(operation: FixedOperation) -> Result<&'static [u8]> { diff --git a/crates/cuda-driver/src/ffi/driver_backed/matvec_projection_launches.rs b/crates/cuda-driver/src/ffi/driver_backed/matvec_projection_launches.rs index c6ad39fe..6027f604 100644 --- a/crates/cuda-driver/src/ffi/driver_backed/matvec_projection_launches.rs +++ b/crates/cuda-driver/src/ffi/driver_backed/matvec_projection_launches.rs @@ -1,8 +1,10 @@ //! Methods of `Api`: `unload`, `launch`, `launch_gr_read_guard`, `launch_matvec` and 8 more. //! Split out of `enabled` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, FunctionHandle, GrReadGuardArguments, LaunchArguments, MatvecArguments, ModuleHandle, ProjectionArguments, + Q5ProjectionArguments, Q6ProjectionArguments, Q8QuantizeArguments, Result, c_void, check, +}; impl Api { pub(crate) fn unload(&self, module: ModuleHandle) -> Result<()> { diff --git a/crates/cuda-driver/src/ffi/driver_backed/mmq_original_group_launches.rs b/crates/cuda-driver/src/ffi/driver_backed/mmq_original_group_launches.rs index a4ac2448..e9bc1bc4 100644 --- a/crates/cuda-driver/src/ffi/driver_backed/mmq_original_group_launches.rs +++ b/crates/cuda-driver/src/ffi/driver_backed/mmq_original_group_launches.rs @@ -1,8 +1,10 @@ //! Methods of `Api`: `mmq_original_group_shared_limit`, `load_mmq_original_group`, `mmq_original_group_function`, `l... //! Split out of `enabled` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, CuDevice, CuResult, Error, FunctionHandle, MMQ_ORIGINAL_GROUP_SYMBOLS, MmqOriginalGatherArguments, + MmqResidentArguments, ModuleHandle, Result, c_int, c_void, check, +}; impl Api { pub(crate) fn mmq_original_group_shared_limit(&self) -> Result { diff --git a/crates/cuda-driver/src/ffi/driver_backed/mmq_resident_qsa_selected_launches.rs b/crates/cuda-driver/src/ffi/driver_backed/mmq_resident_qsa_selected_launches.rs index d36b2129..8621a956 100644 --- a/crates/cuda-driver/src/ffi/driver_backed/mmq_resident_qsa_selected_launches.rs +++ b/crates/cuda-driver/src/ffi/driver_backed/mmq_resident_qsa_selected_launches.rs @@ -1,8 +1,10 @@ //! Methods of `Api`: `launch_mmq_original_swiglu`, `load_mmq_resident`, `mmq_resident_function`, `launch_mmq_residen... //! Split out of `enabled` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, Error, FunctionHandle, MmqArguments, MmqFixupArguments, MmqOriginalSwigluArguments, MmqQuantArguments, + MmqResidentArguments, ModuleHandle, QsaSelectedArguments, Result, c_void, check, +}; impl Api { pub(crate) fn launch_mmq_original_swiglu( diff --git a/crates/cuda-driver/src/ffi/function_handle.rs b/crates/cuda-driver/src/ffi/function_handle.rs index 59a9a628..7bdb2c0d 100644 --- a/crates/cuda-driver/src/ffi/function_handle.rs +++ b/crates/cuda-driver/src/ffi/function_handle.rs @@ -1,8 +1,16 @@ //! Methods of `FunctionHandle`: `qwen_success`, `synthetic`. Methods of `LaunchArguments`: `new`. //! Implements `Drop for LaunchArguments`, `Drop for GrReadGuardArguments` and 3 more. +use super::{ + ArgumentStorage, BufferHandle, LaunchArguments, MatvecArguments, MatvecStorage, ProjectionArguments, + ProjectionStorage, Q5ProjectionArguments, Q5ProjectionStorage, Q6ProjectionArguments, Q6ProjectionStorage, + Q8QuantizeArguments, Q8QuantizeStorage, +}; +#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64", feature = "cuda-driver"))] +use super::{GrReadGuardArguments, GrReadGuardStorage}; +// used only with some cargo features or targets of this crate #[allow(unused_imports)] -use super::*; +use super::{Error, FunctionHandle, Result}; #[cfg(any( test, diff --git a/crates/cuda-driver/src/ffi/q5_projection_arguments_drop.rs b/crates/cuda-driver/src/ffi/q5_projection_arguments_drop.rs index ef82be87..4ed5166a 100644 --- a/crates/cuda-driver/src/ffi/q5_projection_arguments_drop.rs +++ b/crates/cuda-driver/src/ffi/q5_projection_arguments_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for Q5ProjectionArguments`, `Drop for MatvecArguments`. //! Split out of `ffi` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{MatvecArguments, Q5ProjectionArguments}; impl Drop for Q5ProjectionArguments { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/ffi/qsa_selected_arguments.rs b/crates/cuda-driver/src/ffi/qsa_selected_arguments.rs index ac3a297d..3c0db652 100644 --- a/crates/cuda-driver/src/ffi/qsa_selected_arguments.rs +++ b/crates/cuda-driver/src/ffi/qsa_selected_arguments.rs @@ -1,8 +1,7 @@ //! Methods of `QsaSelectedArguments`: `new`, `parameters`. Methods of `HeadGreedyArguments`: `new`, `parameters`. //! Implements `Drop for QsaSelectedArguments`, `Drop for HeadGreedyArguments`. -#[allow(unused_imports)] -use super::*; +use super::{BufferHandle, HeadGreedyArguments, HeadGreedyStorage, QsaSelectedArguments, QsaSelectedStorage}; impl QsaSelectedArguments { pub(crate) fn new(handles: [BufferHandle; 5], layer: u32, count: u32) -> Self { diff --git a/crates/cuda-driver/src/gdn_closed_queue.rs b/crates/cuda-driver/src/gdn_closed_queue.rs index 6753c0c5..66c0d76b 100644 --- a/crates/cuda-driver/src/gdn_closed_queue.rs +++ b/crates/cuda-driver/src/gdn_closed_queue.rs @@ -3,7 +3,10 @@ //! completion fence. It replaces only the discarded host intermediates of the //! scalar chain; arithmetic assets, operand geometry and the causal recurrence //! are the existing ones. It is not a certificate of source, role or row. -use super::*; +use super::{ + Admission, Arguments, Context, DeviceBuffer, Error, Operation, Result, admission, combine, ffi, qwen_ffi, + ranges_layout, registered, +}; const SLOTS: usize = 13; const STATUS_BYTES: usize = SLOTS * 4; diff --git a/crates/cuda-driver/src/gdn_closed_queue/gdn_queue_stage.rs b/crates/cuda-driver/src/gdn_closed_queue/gdn_queue_stage.rs index de9cbde1..98d5d939 100644 --- a/crates/cuda-driver/src/gdn_closed_queue/gdn_queue_stage.rs +++ b/crates/cuda-driver/src/gdn_closed_queue/gdn_queue_stage.rs @@ -1,8 +1,10 @@ //! Methods of `GdnQueueStage`: `words`, `slot`. Methods of `Step`: `next`. //! Functions: `decode_statuses`, `column_row_offset`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, GdnQueueStage, GdnRowCompletion, GdnRowPrefix, GdnRowQueue, Kernels, MAX_COLUMN_ROWS, OPS, + QKV_BYTES, Result, SLOTS, STAGES, STATUS_BYTES, Step, combine, ffi, qwen_ffi, registered, +}; impl GdnQueueStage { /// Exact F32 word count of the whole buffer this stage scans. diff --git a/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix.rs b/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix.rs index aa92f053..e3237a7b 100644 --- a/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix.rs +++ b/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix.rs @@ -1,8 +1,12 @@ //! Groups the submodules `convolution_stages`, `gdn_row_prefix_fenced_drain`, `recurrence_stages`. //! Split out of `gdn_closed_queue` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Admission, Arguments, BETA, CONV, Command, DeviceBuffer, Drained, Error, GATE, GdnConvBuffers, GdnOutNormBuffers, + GdnQueueStage, GdnRecurrenceBuffers, GdnRowCompletion, GdnRowPrefix, HISTORY_BYTES, OPS, OUT_NORM, Operation, QK, + QK_BYTES, QKV_BYTES, Result, SLOTS, STATE_BYTES, STATUS_BYTES, STEP, Step, admission, column_row_offset, combine, + decode_statuses, ffi, qwen_ffi, ranges_layout, staging, +}; #[path = "gdn_row_prefix/convolution_stages.rs"] mod convolution_stages; diff --git a/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/convolution_stages.rs b/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/convolution_stages.rs index bee5df41..23604733 100644 --- a/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/convolution_stages.rs +++ b/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/convolution_stages.rs @@ -1,8 +1,10 @@ //! Methods of `GdnRowPrefix`: `ready`, `latch`, `handle_of`, `same` and 11 more. //! Split out of `gdn_row_prefix` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Admission, Arguments, CONV, Command, DeviceBuffer, Error, GdnConvBuffers, GdnQueueStage, GdnRowPrefix, OPS, + Operation, QKV_BYTES, Result, STATUS_BYTES, Step, admission, column_row_offset, ffi, qwen_ffi, ranges_layout, +}; impl<'lease, 'ctx> GdnRowPrefix<'lease, 'ctx> { pub(in super::super) fn ready(&self, step: Step) -> Result<()> { diff --git a/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/gdn_row_prefix_fenced_drain.rs b/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/gdn_row_prefix_fenced_drain.rs index 2390ae21..fae50168 100644 --- a/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/gdn_row_prefix_fenced_drain.rs +++ b/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/gdn_row_prefix_fenced_drain.rs @@ -1,8 +1,10 @@ //! Methods of `GdnRowPrefix`: `drain`, `drain_buffers`, `decoded_refusal`, `fenced` and 2 more. //! Functions: `fetched_history`, `history_words`. Defines `Fenced`. -#[allow(unused_imports)] -use super::*; +use super::{ + Drained, Error, GdnQueueStage, GdnRowPrefix, HISTORY_BYTES, Result, SLOTS, STATUS_BYTES, combine, decode_statuses, + ffi, staging, +}; impl<'lease, 'ctx> GdnRowPrefix<'lease, 'ctx> { pub(in super::super) fn drain(mut self, fetch: bool) -> Result { diff --git a/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/recurrence_stages.rs b/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/recurrence_stages.rs index 1f4cea4b..f14deb43 100644 --- a/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/recurrence_stages.rs +++ b/crates/cuda-driver/src/gdn_closed_queue/gdn_row_prefix/recurrence_stages.rs @@ -1,8 +1,11 @@ //! Methods of `GdnRowPrefix`: `qk_l2`, `beta_sigmoid`, `gate_softplus`, `recurrence` and 7 more. //! Split out of `gdn_row_prefix` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Admission, Arguments, BETA, Command, DeviceBuffer, Error, GATE, GdnOutNormBuffers, GdnQueueStage, + GdnRecurrenceBuffers, GdnRowCompletion, GdnRowPrefix, HISTORY_BYTES, OUT_NORM, Operation, QK, QK_BYTES, Result, + STATE_BYTES, STATUS_BYTES, STEP, Step, admission, ffi, qwen_ffi, ranges_layout, +}; impl<'lease, 'ctx> GdnRowPrefix<'lease, 'ctx> { /// Original Q/K L2 kernel into the whole 10,240-word slot; the scan covers diff --git a/crates/cuda-driver/src/gdn_closed_queue/gdn_row_queue.rs b/crates/cuda-driver/src/gdn_closed_queue/gdn_row_queue.rs index 4398b2cf..39c2249f 100644 --- a/crates/cuda-driver/src/gdn_closed_queue/gdn_row_queue.rs +++ b/crates/cuda-driver/src/gdn_closed_queue/gdn_row_queue.rs @@ -1,8 +1,7 @@ //! Methods of `GdnRowQueue`: `close_inner`, `release_status`, `release_module`. Methods of `Command`: `launch`. //! Implements `Drop for GdnRowQueue`. Functions: `staging`. -#[allow(unused_imports)] -use super::*; +use super::{Command, Context, DeviceBuffer, Error, GdnRowQueue, Result, combine, ffi}; impl GdnRowQueue<'_> { pub(super) fn close_inner(&mut self) -> Result<()> { diff --git a/crates/cuda-driver/src/gdn_closed_queue_gpu/bytes.rs b/crates/cuda-driver/src/gdn_closed_queue_gpu/bytes.rs index 388b358d..0f1bace4 100644 --- a/crates/cuda-driver/src/gdn_closed_queue_gpu/bytes.rs +++ b/crates/cuda-driver/src/gdn_closed_queue_gpu/bytes.rs @@ -1,8 +1,10 @@ //! Methods of `Row`: `conv_buffers`, `recurrence_buffers`, `out_norm_buffers`, `new` and 7 more. //! Functions: `bytes`, `upload`, `blank`, `read` and 6 more. -#[allow(unused_imports)] -use super::*; +use super::{ + CHANNELS, Context, DeviceBuffer, EPSILON, GdnConvBuffers, GdnOutNormBuffers, GdnRecurrenceBuffers, + GdnRowCompletion, GdnRowPrefix, GdnRowQueue, HISTORY, Poison, Result, Row, STATE, VALUES, combine, +}; use crate::{GdnConvResult, GdnGates, GdnOutNormInput, GdnStepProducts, GdnStepResult}; pub(super) fn bytes(values: &[f32]) -> Vec { diff --git a/crates/cuda-driver/src/gdn_closed_queue_gpu/columns_pair_cases.rs b/crates/cuda-driver/src/gdn_closed_queue_gpu/columns_pair_cases.rs index 2a586857..482c1fb9 100644 --- a/crates/cuda-driver/src/gdn_closed_queue_gpu/columns_pair_cases.rs +++ b/crates/cuda-driver/src/gdn_closed_queue_gpu/columns_pair_cases.rs @@ -1,8 +1,10 @@ //! Functions: `columns_pair`, `poisoned_image`, `compare_columns`, `note_qkv_refusal` and 4 more. //! Defines `ColumnsCase`, `ColumnsPoison`, `RetainedColumns`. -#[allow(unused_imports)] -use super::*; +use super::{ + CHANNELS, Context, DeviceBuffer, Error, GdnQueueStage, GdnRowCompletion, GdnRowQueue, Poison, Report, Result, Row, + bytes, column_image, combine, queued, queued_columns, scalar, upload, +}; /// The batched image of one retained-row case: the salt, the number of rows and the used row. #[derive(Clone, Copy)] diff --git a/crates/cuda-driver/src/gdn_closed_queue_gpu/scenarios.rs b/crates/cuda-driver/src/gdn_closed_queue_gpu/scenarios.rs index 3364846b..00d99a49 100644 --- a/crates/cuda-driver/src/gdn_closed_queue_gpu/scenarios.rs +++ b/crates/cuda-driver/src/gdn_closed_queue_gpu/scenarios.rs @@ -1,8 +1,11 @@ //! The scenarios of the changed GDN row queue proof: clean rows, ordered numerical refusals, retained batched //! rows and the admission refusals, all on one queue. -#[allow(unused_imports)] -use super::*; +use super::{ + CHANNELS, ColumnsCase, ColumnsPoison, Context, DeviceBuffer, EPSILON, Error, GdnQueueStage, GdnRowQueue, Poison, + Report, Result, Row, STATUS_BYTES, blank, clean_pair, column_image, columns_pair, combine, refusal_case, refuse, + upload, +}; /// The whole proof on one queue of `context`; `foreign` supplies the buffers of another Context. pub(super) fn run(context: &Context<'_>, foreign: &Context<'_>, report: &mut Report) -> Result<()> { diff --git a/crates/cuda-driver/src/gdn_fused_t1.rs b/crates/cuda-driver/src/gdn_fused_t1.rs index bda2dafe..6917697f 100644 --- a/crates/cuda-driver/src/gdn_fused_t1.rs +++ b/crates/cuda-driver/src/gdn_fused_t1.rs @@ -21,7 +21,7 @@ //! completion uncertainty poisons the context and leaks the owners. The candidate state/history reach the host only //! after a clean complete drain. use super::gdn_native_batch::GdnStream; -use super::*; +use super::{Context, DeviceBuffer, Error, Result, combine, ffi}; const C: usize = 10_240; const HV: usize = 48; diff --git a/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix.rs b/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix.rs index c493fa63..9c188aa5 100644 --- a/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix.rs +++ b/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix.rs @@ -1,8 +1,11 @@ //! Groups the submodules `fused_stage_binding`, `gdn_fused_prefix_step_norm_drain`. //! Split out of `gdn_fused_t1` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + C, Command, DeviceBuffer, Drained, Error, F16, F32, FusedKernel, GDN_FUSED_T1_STATE_BYTES, GdnAbBuffers, + GdnFusedCompletion, GdnFusedPrefix, GdnFusedStage, GdnStream, HISTORY_WORDS, HV, N_EMBD, Result, Role, S, + STATE_WORDS, STATUS_BYTES, Step, combine, decode_statuses, ffi, linear, staging, words, +}; #[path = "gdn_fused_prefix/fused_stage_binding.rs"] mod fused_stage_binding; diff --git a/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix/fused_stage_binding.rs b/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix/fused_stage_binding.rs index 381ca2d1..a4160750 100644 --- a/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix/fused_stage_binding.rs +++ b/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix/fused_stage_binding.rs @@ -1,8 +1,10 @@ //! Methods of `GdnFusedPrefix`: `ready`, `latch`, `bind`, `push` and 10 more. //! Split out of `gdn_fused_prefix` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + C, Command, DeviceBuffer, Error, F16, F32, FusedKernel, GDN_FUSED_T1_STATE_BYTES, GdnAbBuffers, GdnFusedPrefix, + GdnFusedStage, HV, N_EMBD, Result, Role, S, STATE_WORDS, STATUS_BYTES, Step, ffi, linear, +}; impl<'lease, 'ctx> GdnFusedPrefix<'lease, 'ctx> { pub(in super::super) fn ready(&self, step: Step) -> Result<()> { diff --git a/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix/gdn_fused_prefix_step_norm_drain.rs b/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix/gdn_fused_prefix_step_norm_drain.rs index 87b4e95f..f21921aa 100644 --- a/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix/gdn_fused_prefix_step_norm_drain.rs +++ b/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_prefix/gdn_fused_prefix_step_norm_drain.rs @@ -1,8 +1,11 @@ //! Methods of `GdnFusedPrefix`: `step_norm`, `step_norm_handles`, `push_step_norm`, `fetch_candidate` and 8 more. //! Functions: `fetched_candidate`, `candidate_words`. Defines `DrainBuffers`, `Fenced`. -#[allow(unused_imports)] -use super::*; +use super::{ + DeviceBuffer, Drained, Error, F32, FusedKernel, GDN_FUSED_T1_STATE_BYTES, GdnFusedCompletion, GdnFusedPrefix, + GdnFusedStage, GdnStream, HISTORY_WORDS, HV, Result, Role, S, STATUS_BYTES, Step, combine, decode_statuses, ffi, + staging, words, +}; impl<'lease, 'ctx> GdnFusedPrefix<'lease, 'ctx> { /// `fused_gdn_step_norm`: the in-place state update, readout and per-head norm / ssm_norm / sigmoid(z) gate. diff --git a/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_t1_lifecycle.rs b/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_t1_lifecycle.rs index b5097c52..469d8260 100644 --- a/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_t1_lifecycle.rs +++ b/crates/cuda-driver/src/gdn_fused_t1/gdn_fused_t1_lifecycle.rs @@ -2,8 +2,10 @@ //! result. //! Apart from `gdn_fused_t1.rs`, which holds the types and fields. -#[allow(unused_imports)] -use super::*; +use super::{ + Bindings, Command, Context, Error, FUSED_KERNELS, FusedKernel, GdnFusedCompletion, GdnFusedPrefix, GdnFusedStage, + GdnFusedT1, RESERVE, Result, SLOTS, STATUS_BYTES, Step, combine, ffi, linear, +}; impl<'ctx> GdnFusedT1<'ctx> { pub(super) fn new(context: &'ctx Context<'ctx>) -> Result { diff --git a/crates/cuda-driver/src/gdn_fused_t1/pinned.rs b/crates/cuda-driver/src/gdn_fused_t1/pinned.rs index 2f4857bb..78aabcc0 100644 --- a/crates/cuda-driver/src/gdn_fused_t1/pinned.rs +++ b/crates/cuda-driver/src/gdn_fused_t1/pinned.rs @@ -1,8 +1,10 @@ //! Methods of `FusedKernel`: `entry`, `index`. Methods of `GdnFusedStage`: `slot`, `elements`, `bytes`. //! Functions: `pinned`, `fused_asset`, `linear`, `decode_statuses`. -#[allow(unused_imports)] -use super::*; +use super::{ + Bindings, C, Context, Error, F32, FUSED_PTX_LEN, FUSED_PTX_SHA256, FusedKernel, GdnFusedStage, GdnFusedT1, + HISTORY_WORDS, HV, ROLES, Result, Role, SLOTS, STATE_WORDS, STATUS_BYTES, Step, VALUES, ffi, +}; pub(super) fn pinned(ptx: &'static [u8], len: usize, digest: [u8; 32]) -> Result<&'static [u8]> { if ptx.last() != Some(&0) || !ptx[..ptx.len() - 1].is_ascii() || ptx[..ptx.len() - 1].contains(&0) { diff --git a/crates/cuda-driver/src/gdn_fused_t1/words.rs b/crates/cuda-driver/src/gdn_fused_t1/words.rs index 0880fb4d..a9bf6b17 100644 --- a/crates/cuda-driver/src/gdn_fused_t1/words.rs +++ b/crates/cuda-driver/src/gdn_fused_t1/words.rs @@ -1,8 +1,10 @@ //! Methods of `GdnFusedT1`: `close_inner`, `release_status`, `release_module`, `replay_state_from_products`. //! Methods of `GdnFusedPrefix`: `bind_replay`, `finish_device`. Implements `Drop for GdnFusedT1`. -#[allow(unused_imports)] -use super::*; +use super::{ + C, DeviceBuffer, Error, F32, FusedKernel, GdnFusedPrefix, GdnFusedStage, GdnFusedT1, GdnReplayBuffers, HV, Result, + Role, S, STATE_WORDS, Step, VALUES, combine, ffi, +}; pub(super) fn words(bytes: &[u8], decode: fn([u8; 4]) -> T) -> Result> { let mut values = Vec::new(); diff --git a/crates/cuda-driver/src/gdn_native_batch.rs b/crates/cuda-driver/src/gdn_native_batch.rs index d5683faf..8623e5dd 100644 --- a/crates/cuda-driver/src/gdn_native_batch.rs +++ b/crates/cuda-driver/src/gdn_native_batch.rs @@ -18,7 +18,7 @@ //! earliest-stage refusal; completion uncertainty poisons the context and the //! launch/staging owners are leaked on purpose. There is no per-row mid-chunk //! publication: a refusal anywhere discards the whole chunk. -use super::*; +use super::{Context, DeviceBuffer, Error, Result, combine, ffi}; /// Most token rows of one chunk (largest scan stays below the 2^25-word helper limit). pub const GDN_BATCH_MAX_TOKENS: usize = 2048; diff --git a/crates/cuda-driver/src/gdn_native_batch/context.rs b/crates/cuda-driver/src/gdn_native_batch/context.rs index 5dace4eb..608901b1 100644 --- a/crates/cuda-driver/src/gdn_native_batch/context.rs +++ b/crates/cuda-driver/src/gdn_native_batch/context.rs @@ -1,8 +1,11 @@ //! Methods of `Context`: `gdn_prefill_batch`, `gdn_prefill_batch_for_prompt`. //! Methods of `GdnPrefillBatch`: `new`, `new_capacity`, `open`, `load_functions` and 6 more. Functions: `reserved`. -#[allow(unused_imports)] -use super::*; +use super::{ + Bindings, Command, Context, Error, Functions, GDN_BATCH_MAX_TOKENS, GdnBatchCompletion, GdnBatchPrefix, + GdnBatchStage, GdnGemm, GdnPrefillBatch, GdnStream, KERNELS, Kernel, Result, SLOTS, STATUS_BYTES, Step, combine, + ffi, linear, +}; /// An empty vector with room for `capacity` elements, or a typed host-allocation failure. fn reserved(capacity: usize) -> Result> { diff --git a/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix.rs b/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix.rs index 4b23ed47..8bacfcb5 100644 --- a/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix.rs +++ b/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix.rs @@ -1,8 +1,11 @@ //! Groups the submodules `native_projection`, `qkv_and_z_projections`, `recurrence_and_output`. //! Split out of `gdn_native_batch` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + C, CONV_TILE, Command, DeviceBuffer, Drained, Error, F16, F32, GDN_BATCH_EPSILON, GdnBatchCompletion, + GdnBatchPrefix, GdnBatchStage, GdnNativeFormat, GemmShape, HISTORY_WORDS, HV, Kernel, N, Result, Role, S, + STATE_WORDS, STATUS_BYTES, Step, ZV, combine, decode_statuses, ffi, linear, staging, +}; #[path = "gdn_batch_prefix/native_projection.rs"] mod native_projection; diff --git a/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/native_projection.rs b/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/native_projection.rs index d49609bf..518f6484 100644 --- a/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/native_projection.rs +++ b/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/native_projection.rs @@ -1,8 +1,10 @@ //! Methods of `GdnBatchPrefix`: `tokens`, `ready`, `latch`, `function` and 12 more. Functions: `size_admitted`. //! Defines `NativeProjection`, `ProjectionOperands`. -#[allow(unused_imports)] -use super::*; +use super::{ + Command, DeviceBuffer, Error, F16, F32, GdnBatchPrefix, GdnBatchStage, GdnNativeFormat, GemmShape, Kernel, N, + Result, Role, STATUS_BYTES, Step, ffi, linear, +}; /// The shape of one native projection: the GGUF `format`, the matrix `rows` x `depth` and the byte size of the f32 /// output. diff --git a/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/qkv_and_z_projections.rs b/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/qkv_and_z_projections.rs index 3d96b2a4..16f37947 100644 --- a/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/qkv_and_z_projections.rs +++ b/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/qkv_and_z_projections.rs @@ -2,8 +2,10 @@ //! Split out of `gdn_batch_prefix` to keep its files under the line limit. use super::native_projection::{NativeProjection, ProjectionOperands}; -#[allow(unused_imports)] -use super::*; +use super::{ + C, CONV_TILE, Command, DeviceBuffer, F16, F32, GDN_BATCH_EPSILON, GdnBatchPrefix, GdnBatchStage, GdnNativeFormat, + GemmShape, HISTORY_WORDS, HV, Kernel, N, Result, Role, Step, ZV, ffi, linear, +}; impl<'lease, 'ctx> GdnBatchPrefix<'lease, 'ctx> { /// Native `attn_qkv` projection: dequantize to FP16, `Y[T,10240] = X . W^T` diff --git a/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/recurrence_and_output.rs b/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/recurrence_and_output.rs index 2dc70316..d9e48a8c 100644 --- a/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/recurrence_and_output.rs +++ b/crates/cuda-driver/src/gdn_native_batch/gdn_batch_prefix/recurrence_and_output.rs @@ -2,8 +2,11 @@ //! Functions: `fetched_history`, `history_words`. Defines `Fenced`. use super::native_projection::{NativeProjection, ProjectionOperands}; -#[allow(unused_imports)] -use super::*; +use super::{ + DeviceBuffer, Drained, Error, F16, F32, GDN_BATCH_EPSILON, GdnBatchCompletion, GdnBatchPrefix, GdnBatchStage, + GdnNativeFormat, HISTORY_WORDS, HV, Kernel, N, Result, Role, S, STATE_WORDS, STATUS_BYTES, Step, ZV, combine, + decode_statuses, ffi, staging, +}; impl<'lease, 'ctx> GdnBatchPrefix<'lease, 'ctx> { /// `gdn_rec_cols_pipe`: the whole-chunk recurrence. `state_in` is the diff --git a/crates/cuda-driver/src/gdn_native_batch/pinned.rs b/crates/cuda-driver/src/gdn_native_batch/pinned.rs index b133c39a..5241e86f 100644 --- a/crates/cuda-driver/src/gdn_native_batch/pinned.rs +++ b/crates/cuda-driver/src/gdn_native_batch/pinned.rs @@ -1,8 +1,11 @@ //! Methods of `Kernel`: `entry`, `is_dequant`, `index`. //! Methods of `GdnNativeFormat`: `ggml_type`, `block`, `kernel`, `matrix_bytes`. -#[allow(unused_imports)] -use super::*; +use super::{ + Bindings, C, DEQUANT_PTX_LEN, DEQUANT_PTX_SHA256, Error, F16, F32, Functions, GdnBatchStage, GdnNativeFormat, + GdnStream, HISTORY_WORDS, HV, Kernel, N, PREFILL_PTX_LEN, PREFILL_PTX_SHA256, ROLES, Result, Role, SLOTS, STAGES, + STATE_WORDS, STATUS_BYTES, Step, ZV, ffi, +}; pub(super) fn pinned(ptx: &'static [u8], len: usize, digest: [u8; 32], what: &'static str) -> Result<&'static [u8]> { if ptx.last() != Some(&0) || !ptx[..ptx.len() - 1].is_ascii() || ptx[..ptx.len() - 1].contains(&0) { diff --git a/crates/cuda-driver/src/gdn_native_batch/staging.rs b/crates/cuda-driver/src/gdn_native_batch/staging.rs index c9ea97b9..95eb88a9 100644 --- a/crates/cuda-driver/src/gdn_native_batch/staging.rs +++ b/crates/cuda-driver/src/gdn_native_batch/staging.rs @@ -1,8 +1,7 @@ //! Methods of `GdnPrefillBatch`: `close_inner`, `release_status`, `release_module`. //! Implements `Drop for GdnPrefillBatch`. Functions: `staging`. -#[allow(unused_imports)] -use super::*; +use super::{DeviceBuffer, Error, GdnPrefillBatch, Result, combine, ffi}; pub(super) fn staging(bytes: usize) -> Result> { let mut result = Vec::new(); diff --git a/crates/cuda-driver/src/gdn_native_batch_abi.rs b/crates/cuda-driver/src/gdn_native_batch_abi.rs index f6b869c8..be9a36b4 100644 --- a/crates/cuda-driver/src/gdn_native_batch_abi.rs +++ b/crates/cuda-driver/src/gdn_native_batch_abi.rs @@ -2,7 +2,7 @@ //! native FP16 dequantization module. Every launch owns its own stable Box so //! the pointees never move between enqueue and the single final synchronize. //! Declared as a child of `ffi` (like `mmq_ffi.rs`) for access to `BufferHandle`. -use super::*; +use super::{BufferHandle, Error, Result}; use std::ffi::c_void; /// Most parameters any kernel of the two modules takes. diff --git a/crates/cuda-driver/src/gdn_native_batch_gpu/bytes_of.rs b/crates/cuda-driver/src/gdn_native_batch_gpu/bytes_of.rs index 09af3b9f..30368f75 100644 --- a/crates/cuda-driver/src/gdn_native_batch_gpu/bytes_of.rs +++ b/crates/cuda-driver/src/gdn_native_batch_gpu/bytes_of.rs @@ -1,8 +1,7 @@ //! Functions: `bytes_of`, `words_of`, `halves_of`, `f16_bits` and 15 more. Defines `Projections`. //! Split out of `gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{C, EPS, HISTORY_WORDS, HV, HostInputs, Q8_0_BLOCK, Reference, S, ZV}; // ---------------------------------------------------------------- host numerics helpers pub(super) fn bytes_of(values: &[f32]) -> Vec { diff --git a/crates/cuda-driver/src/gdn_native_batch_gpu/host_gemm_adapter.rs b/crates/cuda-driver/src/gdn_native_batch_gpu/host_gemm_adapter.rs index 54f57166..95d6d0ba 100644 --- a/crates/cuda-driver/src/gdn_native_batch_gpu/host_gemm_adapter.rs +++ b/crates/cuda-driver/src/gdn_native_batch_gpu/host_gemm_adapter.rs @@ -1,8 +1,11 @@ //! Methods of `HostGemm`: `run`, `poison_output`, `capture`. Methods of `Fixture`: `new`, `release`. //! Implements `GdnGemm for HostGemm`. Functions: `host_gemm`, `upload`, `read`, `mismatch`. -#[allow(unused_imports)] -use super::*; +use super::{ + C, Context, DeviceBuffer, Error, Fixture, FixtureInputs, FixtureOutputs, GdnGemm, GdnStream, GemmShape, + HISTORY_WORDS, HV, HostGemm, HostInputs, N, Poison, Result, S, STATE_WORDS, ZV, bf_bits, bf_value, bytes_of, + combine, f16_value, halves_of, pattern, q8_0, words_of, +}; impl HostGemm { pub(super) fn run(&self, bf16: bool, [x, w, y]: [&DeviceBuffer<'_>; 3], shape: GemmShape) -> Result<()> { diff --git a/crates/cuda-driver/src/gdn_native_batch_gpu/run_case.rs b/crates/cuda-driver/src/gdn_native_batch_gpu/run_case.rs index 5eaeff3c..8b765471 100644 --- a/crates/cuda-driver/src/gdn_native_batch_gpu/run_case.rs +++ b/crates/cuda-driver/src/gdn_native_batch_gpu/run_case.rs @@ -1,8 +1,11 @@ //! Functions: `run_case`, `check_case`, `push_program`, `inputs_untouched` and 8 more. //! Split out of `gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + C, Captured, Cell, Context, Error, Fixture, GdnBatchPrefix, GdnBatchStage, GdnNativeFormat, GdnPrefillBatch, HV, + HostGemm, N, Poison, Projections, RefCell, Reference, Result, ZV, bf_bits, bf_value, bytes_of, close, combine, + f16_bits, f16_value, halves_of, mismatch, q8_0, read, reference, words_of, +}; /// One complete program for `tokens` rows; returns the completion and, when the /// program finished clean, the checks against the host reference. diff --git a/crates/cuda-driver/src/gdn_prompt_device.rs b/crates/cuda-driver/src/gdn_prompt_device.rs index 3085d923..c3e0909f 100644 --- a/crates/cuda-driver/src/gdn_prompt_device.rs +++ b/crates/cuda-driver/src/gdn_prompt_device.rs @@ -1,6 +1,10 @@ //! Literal Original prompt GDN over the physical R/GR arena. No mixed or Block //! payload roundtrip and no fabricated DeviceBuffer for a carved span. -use super::*; +use super::{ + Bindings, C, Context, DeviceBuffer, Error, Functions, GDN_BATCH_EPSILON, GdnBatchStage, GdnNativeFormat, + GdnPrefillBatch, GdnStream, HISTORY_WORDS, HV, Kernel, N, Result, Role, S, SLOTS, STATE_WORDS, STATUS_BYTES, ZV, + combine, decode_statuses, ffi, linear, staging, +}; use crate::original_prefill_arena::OriginalPromptSpan; use crate::original_prefill_layout::PrefillPhase; use crate::ple_batch_ffi::{BatchArg as A, KernelArguments, KernelModule}; diff --git a/crates/cuda-driver/src/gdn_prompt_device/context.rs b/crates/cuda-driver/src/gdn_prompt_device/context.rs index 260ed5f2..7bc47b29 100644 --- a/crates/cuda-driver/src/gdn_prompt_device/context.rs +++ b/crates/cuda-driver/src/gdn_prompt_device/context.rs @@ -1,8 +1,7 @@ //! Methods of `Context`: `original_gdn_prompt_device`, `original_gdn_prompt_device_with`. //! Split out of `prompt_device` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, GdnPromptOptions, OriginalGdnPromptDevice, Result}; impl<'ctx> Context<'ctx> { pub fn original_gdn_prompt_device( diff --git a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device.rs b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device.rs index 59555a9d..046d752e 100644 --- a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device.rs +++ b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device.rs @@ -1,8 +1,13 @@ //! Groups the submodules `gdn_prompt_run_buffer_binder`, `original_gdn_prompt_device_admit_open`, `original_gdn_prom... //! Split out of `prompt_device` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, Bindings, C, Context, DeviceBuffer, DeviceCommand, Error, Functions, GDN_BATCH_EPSILON, GdnBatchStage, + GdnNativeFormat, GdnPrefillBatch, GdnPromptOptions, GdnStream, HISTORY, HISTORY_WORDS, HV, Kernel, KernelArguments, + KernelModule, N, NativeBatchWorkspace, OriginalDeviceBlock, OriginalDeviceGrRead, OriginalGdnPromptDevice, + OriginalGdnPromptState, OriginalGdnPromptWeights, OriginalPromptSpan, PrefillPhase, RESERVE, Result, Role, S, + SCRATCH, SLOTS, STATE_WORDS, STATUS_BYTES, ZV, combine, decode_statuses, ffi, linear, staging, +}; #[path = "original_gdn_prompt_device/gdn_prompt_run_buffer_binder.rs"] mod gdn_prompt_run_buffer_binder; diff --git a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/gdn_prompt_run_buffer_binder.rs b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/gdn_prompt_run_buffer_binder.rs index e2e019f8..16ae5553 100644 --- a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/gdn_prompt_run_buffer_binder.rs +++ b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/gdn_prompt_run_buffer_binder.rs @@ -1,8 +1,10 @@ //! Buffers of `OriginalGdnPromptDevice::produce` (STRA-338): the admitted handles of a run and the binder that admits //! them (owner, extent, alias and role checks) in the order of the former single function. -#[allow(unused_imports)] -use super::*; +use super::{ + Bindings, Context, DeviceBuffer, Error, NativeBatchWorkspace, OriginalPromptSpan, PrefillPhase, Result, Role, + STATUS_BYTES, ffi, +}; use crate::OriginalPromptRows; /// How a span is carved out of the prompt arena: a phase span of the GDN layout or a common span, with its row width. diff --git a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_admit_open.rs b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_admit_open.rs index 05356c45..3407b25b 100644 --- a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_admit_open.rs +++ b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_admit_open.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalGdnPromptDevice`: `device_bytes`, `new`, `admit_budget`, `open` and 2 more. //! Split out of `original_gdn_prompt_device` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, GdnPrefillBatch, GdnPromptOptions, HISTORY, OriginalGdnPromptDevice, RESERVE, Result, + SCRATCH, STATUS_BYTES, TensorCoreState, +}; impl<'ctx> OriginalGdnPromptDevice<'ctx> { pub fn device_bytes(capacity: usize) -> Result { diff --git a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_close.rs b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_close.rs index cf004871..1c943728 100644 --- a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_close.rs +++ b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_close.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalGdnPromptDevice`: `close`, `close_inner`, `release_stage`, `release_batch`. //! Functions: `release_buffer`. -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, Error, GdnPrefillBatch, KernelModule, OriginalGdnPromptDevice, Result, combine}; /// Releases one buffer, or leaks it when the context is poisoned (nothing may be freed against an uncertain one). fn release_buffer(context: &Context<'_>, b: DeviceBuffer<'_>) -> Result<()> { diff --git a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_drain.rs b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_drain.rs index 0eec13ea..8d40e6b1 100644 --- a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_drain.rs +++ b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_drain.rs @@ -2,8 +2,10 @@ //! status words and the final history back, and decides whether the run was clean. A failed drain retains the command //! and host buffers, because driver work may still reference them. -#[allow(unused_imports)] -use super::*; +use super::{ + DeviceCommand, Error, GdnBatchStage, GdnStream, HISTORY, HISTORY_WORDS, Handles, KernelModule, + NativeBatchWorkspace, OriginalGdnPromptDevice, Result, SLOTS, STATUS_BYTES, combine, decode_statuses, ffi, staging, +}; use crate::CurrentGuard; use crate::ple_batch_ffi::{GdnGemmLayout, GemmDims, GemmOperands, LinearLaunch}; diff --git a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_block_produce.rs b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_block_produce.rs index 8b033aed..f766b5a3 100644 --- a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_block_produce.rs +++ b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_block_produce.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalGdnPromptDevice`: `produce`, `admit`, `admit_handles`, `admit_state` and 4 more. //! `produce` admits the buffers, records the command list (`prompt_command_list.rs`) and drains it (`original_gdn_pr... -#[allow(unused_imports)] -use super::*; +use super::{ + Binder, Bindings, C, Carve, Carved, DeviceBuffer, Error, HISTORY, HISTORY_WORDS, HV, Handles, N, + NativeBatchWorkspace, OriginalDeviceBlock, OriginalDeviceGrRead, OriginalGdnPromptDevice, OriginalGdnPromptState, + OriginalGdnPromptWeights, OriginalPromptSpan, Phase, Result, Role, S, SCRATCH, STATE_WORDS, ZV, ffi, +}; use crate::OriginalPromptRows; impl<'ctx> OriginalGdnPromptDevice<'ctx> { diff --git a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_command_list.rs b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_command_list.rs index 52372493..fe19092b 100644 --- a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_command_list.rs +++ b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_command_list.rs @@ -1,8 +1,10 @@ //! Command list of `OriginalGdnPromptDevice::produce` (STRA-338): the kernels, GEMMs and prefill-stage launches of one //! run, recorded in the order of the former single function. Nothing is submitted here. -#[allow(unused_imports)] -use super::*; +use super::{ + A, C, Context, DeviceCommand, Error, Functions, GDN_BATCH_EPSILON, GdnBatchStage, GdnNativeFormat, HV, Handles, + Kernel, KernelArguments, N, OriginalGdnPromptDevice, Result, SCRATCH, SLOTS, STATUS_BYTES, ZV, ffi, linear, +}; use crate::gdn_prefill_tc as tc; /// The commands of one run under construction. diff --git a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_tensor_core_scan.rs b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_tensor_core_scan.rs index 33b79de9..b464b6db 100644 --- a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_tensor_core_scan.rs +++ b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device/prompt_tensor_core_scan.rs @@ -5,8 +5,9 @@ //! recurrence (every command of a run is on one stream; the projections' dequantization wrote it before and the //! output projection's rewrites it after), so it costs no device memory and the prefill budget is unchanged. -#[allow(unused_imports)] -use super::*; +use super::{Error, KernelArguments, KernelModule, OriginalGdnPromptDevice, Result, SCRATCH, combine}; +#[cfg(test)] +use super::GdnPromptOptions; use crate::gdn_prefill_tc as tc; use crate::ple_batch_ffi::LinearLaunch; diff --git a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device_drop.rs b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device_drop.rs index 45e7e3ae..58acda75 100644 --- a/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device_drop.rs +++ b/crates/cuda-driver/src/gdn_prompt_device/original_gdn_prompt_device_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for OriginalGdnPromptDevice`. //! Split out of `prompt_device` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::OriginalGdnPromptDevice; impl Drop for OriginalGdnPromptDevice<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/gdn_state_finite_guard.rs b/crates/cuda-driver/src/gdn_state_finite_guard.rs index 12dd6aa6..5ee3ee4c 100644 --- a/crates/cuda-driver/src/gdn_state_finite_guard.rs +++ b/crates/cuda-driver/src/gdn_state_finite_guard.rs @@ -1,6 +1,6 @@ //! Closed complete finite witness for the canonical GDN next-state allocation. //! Reuses the pinned integer exponent scan; performs no floating-point arithmetic. -use super::*; +use super::{Context, DeviceBuffer, Error, Rc, Result, combine, ffi}; const STATE_BYTES: usize = 3_145_728; const STATE_WORDS: u32 = 786_432; diff --git a/crates/cuda-driver/src/gr_batch_inject_workspace.rs b/crates/cuda-driver/src/gr_batch_inject_workspace.rs index fa93aaf5..09ee9812 100644 --- a/crates/cuda-driver/src/gr_batch_inject_workspace.rs +++ b/crates/cuda-driver/src/gr_batch_inject_workspace.rs @@ -1,6 +1,6 @@ //! Closed upload scheduling for the original BatchGrInject kernel. //! Raw completed output is not a model, finite, row or publication certificate. -use super::*; +use super::{Arguments, Context, DeviceBuffer, Error, Operation, Result, combine, ffi, qwen_ffi, ranges_layout}; const ROW_BYTES: [usize; 4] = [40960, 10240, 16, 40960]; const RESERVE: usize = 128 * 1024 * 1024; diff --git a/crates/cuda-driver/src/gr_batch_read.rs b/crates/cuda-driver/src/gr_batch_read.rs index cb8ef5a5..b41903df 100644 --- a/crates/cuda-driver/src/gr_batch_read.rs +++ b/crates/cuda-driver/src/gr_batch_read.rs @@ -2,7 +2,10 @@ //! loop: all actual row offsets are admitted before one queued completion. //! This preserves MMVF F32 operands/reduction; it does not claim Strata GEMM //! rounding equivalence or expose a model/row/finite capability. -use super::*; +use super::{ + Arguments, Context, DeviceBuffer, Error, FixedKernel, Operation, Result, combine, ffi, qwen_ffi, ranges_layout, + registered, +}; const SIZES: [usize; 11] = [40960, 40960, 1280, 1280, 40960, 40960, 10240, 16, 10240, 40960, 32]; const OPS: [Operation; 6] = [ diff --git a/crates/cuda-driver/src/gr_batch_read/context.rs b/crates/cuda-driver/src/gr_batch_read/context.rs index 7dbf7d6c..eccf3342 100644 --- a/crates/cuda-driver/src/gr_batch_read/context.rs +++ b/crates/cuda-driver/src/gr_batch_read/context.rs @@ -1,8 +1,7 @@ //! Methods of `Context`: `gr_microbatch_read`. Functions: `checked_row`, `encode`. //! Split out of `gr_batch_read` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, Error, GrMicrobatchRead, Result}; impl Context<'_> { pub fn gr_microbatch_read(&self, tokens: usize, streams: &[f32]) -> Result> { diff --git a/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read.rs b/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read.rs index f88aeb16..759eb1a7 100644 --- a/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read.rs +++ b/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read.rs @@ -1,8 +1,10 @@ //! Groups the submodules `gr_microbatch_read_inject`, `gr_microbatch_read_open`, `micro_stage_launch`. //! Split out of `gr_batch_read` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arguments, Context, DeviceBuffer, Error, FixedKernel, GrMicroValues, GrMicrobatchRead, OPS, Operation, RESERVE, + Result, SIZES, STAGES, checked_row, combine, decode, encode, ffi, qwen_ffi, ranges_layout, registered, +}; #[path = "gr_microbatch_read/gr_microbatch_read_inject.rs"] mod gr_microbatch_read_inject; diff --git a/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/gr_microbatch_read_inject.rs b/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/gr_microbatch_read_inject.rs index e3027273..ad94c917 100644 --- a/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/gr_microbatch_read_inject.rs +++ b/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/gr_microbatch_read_inject.rs @@ -1,8 +1,10 @@ //! Methods of `GrMicrobatchRead`: `inject`, `inject_handles`, `inject_admit`, `inject_arguments` and 11 more. //! Split out of `gr_microbatch_read` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arguments, Error, FixedKernel, GrMicrobatchRead, Operation, Result, combine, decode, encode, ffi, qwen_ffi, + ranges_layout, registered, +}; impl<'ctx> GrMicrobatchRead<'ctx> { /// Original residual write consumes retained real input and injection banks. diff --git a/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/gr_microbatch_read_open.rs b/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/gr_microbatch_read_open.rs index a875dd54..b00dce61 100644 --- a/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/gr_microbatch_read_open.rs +++ b/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/gr_microbatch_read_open.rs @@ -1,8 +1,10 @@ //! Methods of `GrMicrobatchRead`: `new`, `admit_inputs`, `open`, `load_finite` and 10 more. //! Split out of `gr_microbatch_read` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arguments, Context, DeviceBuffer, Error, GrMicrobatchRead, OPS, Operation, RESERVE, Result, SIZES, checked_row, + combine, encode, ffi, qwen_ffi, ranges_layout, +}; impl<'ctx> GrMicrobatchRead<'ctx> { pub(in super::super) fn new(context: &'ctx Context<'ctx>, tokens: usize, streams: &[f32]) -> Result { diff --git a/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/micro_stage_launch.rs b/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/micro_stage_launch.rs index 29b9ac1d..80b09420 100644 --- a/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/micro_stage_launch.rs +++ b/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read/micro_stage_launch.rs @@ -1,8 +1,10 @@ //! Methods of `GrMicrobatchRead`: `read`, `micro_kernels_guarded`, `micro_enqueue`, `micro_complete` and 6 more. //! Defines `MicroKernels`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arguments, DeviceBuffer, Error, FixedKernel, GrMicroValues, GrMicrobatchRead, OPS, Result, SIZES, STAGES, combine, + decode, ffi, qwen_ffi, registered, +}; /// The six registered GR kernels and the finite-scan function of one micro-batch launch. #[derive(Clone, Copy)] diff --git a/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read_drop.rs b/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read_drop.rs index 7961c421..6ee6d183 100644 --- a/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read_drop.rs +++ b/crates/cuda-driver/src/gr_batch_read/gr_microbatch_read_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for GrMicrobatchRead`. Functions: `decode`. //! Split out of `gr_batch_read` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{DeviceBuffer, Error, GrMicrobatchRead, Result}; impl Drop for GrMicrobatchRead<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/gr_native_batch.rs b/crates/cuda-driver/src/gr_native_batch.rs index ff8a83eb..46930a93 100644 --- a/crates/cuda-driver/src/gr_native_batch.rs +++ b/crates/cuda-driver/src/gr_native_batch.rs @@ -1,6 +1,6 @@ //! Explicit Original Strata whole-T GR norm/BF16 GEMM/mix/write owner. //! No MMVF substitution and no env inference. Root-sealed asset required. -use super::*; +use super::{Context, DeviceBuffer, Error, Result, combine, ffi}; use crate::ple_batch_ffi::{BatchArg as A, Blas, KernelArguments, KernelModule}; use crate::{CurrentGuard, NativeBatchWorkspace}; use std::ffi::CStr; diff --git a/crates/cuda-driver/src/gr_native_batch/context.rs b/crates/cuda-driver/src/gr_native_batch/context.rs index 460c360c..a4245dcd 100644 --- a/crates/cuda-driver/src/gr_native_batch/context.rs +++ b/crates/cuda-driver/src/gr_native_batch/context.rs @@ -1,8 +1,7 @@ //! Methods of `Context`: `gr_native_batch`, `gr_native_prompt_batch`. Functions: `encode`, `decode`. //! Split out of `gr_native_batch` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, Error, GrNativeBatch, GrNativeProfile, Result}; impl Context<'_> { pub fn gr_native_batch( diff --git a/crates/cuda-driver/src/gr_native_batch/gr_native_batch_drop.rs b/crates/cuda-driver/src/gr_native_batch/gr_native_batch_drop.rs index 221ffb2e..f76b3277 100644 --- a/crates/cuda-driver/src/gr_native_batch/gr_native_batch_drop.rs +++ b/crates/cuda-driver/src/gr_native_batch/gr_native_batch_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for GrNativeBatch`. //! Split out of `gr_native_batch` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::GrNativeBatch; impl Drop for GrNativeBatch<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations.rs b/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations.rs index 2d2b68ec..94278a0a 100644 --- a/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations.rs +++ b/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations.rs @@ -2,8 +2,10 @@ //! inject. //! One impl split over these files so that each stays under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, BYTES, Blas, Context, CurrentGuard, DeviceBuffer, ENTRIES, Error, GrNativeBatch, GrNativeProfile, + KernelArguments, KernelModule, NativeBatchWorkspace, PTX, RESERVE, Result, STAGES, combine, decode, encode, ffi, +}; #[path = "gr_native_batch_operations/native_command_drain.rs"] mod native_command_drain; diff --git a/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_command_drain.rs b/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_command_drain.rs index 4b6d2fb3..c0993ded 100644 --- a/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_command_drain.rs +++ b/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_command_drain.rs @@ -2,8 +2,10 @@ //! Defines `NativeDrain`. use super::native_gemm_launch::GemmRoles; -#[allow(unused_imports)] -use super::*; +use super::{ + A, Blas, CurrentGuard, DeviceBuffer, Error, GrNativeBatch, KernelArguments, NativeBatchWorkspace, Result, STAGES, + combine, decode, ffi, +}; use crate::ple_batch_ffi::LinearLaunch; /// The retained host ABI and staging of one drain: the eligible stages, the zeroed status words, the kernel diff --git a/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_gemm_launch.rs b/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_gemm_launch.rs index 497d3b49..4b4d1274 100644 --- a/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_gemm_launch.rs +++ b/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_gemm_launch.rs @@ -1,8 +1,10 @@ //! Methods of `GrNativeBatch`: `prompt_device_bytes`, `new`, `new_bounded`, `check_new_inputs` and 15 more. //! Defines `GemmRoles`. -#[allow(unused_imports)] -use super::*; +use super::{ + A, BYTES, Blas, Context, DeviceBuffer, ENTRIES, Error, GrNativeBatch, GrNativeProfile, KernelArguments, + KernelModule, PTX, RESERVE, Result, combine, encode, ffi, +}; use crate::ple_batch_ffi::{GemmDims, GemmOperands, GemmScalars, LinearLaunch}; /// The buffer slots, weight and `n` x `k` shape of one Original GEMM. diff --git a/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_inject.rs b/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_inject.rs index cdde43b2..908906e8 100644 --- a/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_inject.rs +++ b/crates/cuda-driver/src/gr_native_batch/gr_native_batch_operations/native_inject.rs @@ -2,8 +2,10 @@ //! Defines `StatusReset`. use super::native_command_drain::NativeDrain; -#[allow(unused_imports)] -use super::*; +use super::{ + A, Blas, Context, DeviceBuffer, Error, GrNativeBatch, KernelArguments, KernelModule, NativeBatchWorkspace, Result, + combine, decode, encode, ffi, +}; /// The status words of one command list: their device handle and the zero image that resets them. #[derive(Clone, Copy)] diff --git a/crates/cuda-driver/src/gr_read_guard.rs b/crates/cuda-driver/src/gr_read_guard.rs index 17a75e92..7089d0f2 100644 --- a/crates/cuda-driver/src/gr_read_guard.rs +++ b/crates/cuda-driver/src/gr_read_guard.rs @@ -1,5 +1,10 @@ //! Closed finite witness for five immutable real GR intermediate buffers. -use super::*; +use super::{Context, DeviceBuffer, Error, Result, combine, ffi}; +#[cfg(test)] +use super::Driver; +// used only with some cargo features or targets of this crate +#[allow(unused_imports)] +use super::{FixedOperation, Rc}; const BYTES: [usize; 5] = [40960, 1280, 1280, 40960, 40960]; fn shape(bytes: [usize; 5]) -> Result<()> { if bytes != BYTES { diff --git a/crates/cuda-driver/src/grouped_gu21_gu23_gpu/grouped_numeric_run.rs b/crates/cuda-driver/src/grouped_gu21_gu23_gpu/grouped_numeric_run.rs index 6bdf4279..96f7c8e6 100644 --- a/crates/cuda-driver/src/grouped_gu21_gu23_gpu/grouped_numeric_run.rs +++ b/crates/cuda-driver/src/grouped_gu21_gu23_gpu/grouped_numeric_run.rs @@ -1,8 +1,10 @@ //! Methods of `GuRig`: `new`, `finish`. Methods of `ScalarBuffers`: `new`, `release`, `column`, `down_columns`. //! Functions: `scalar_products`, `input_unchanged`, `close_owners`, `release_inputs` and 2 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Comparison, Context, DeviceBuffer, DownColumns, ProjectionKind, ProjectionSpec, Result, RoutedFormat, + RoutedGateUpQ8, down_weights, gu_weights, input, read, upload, +}; /// The uploaded raw weights shared by every corpus of one gate/up format. struct GuRig<'a> { diff --git a/crates/cuda-driver/src/grouped_gu21_gu23_gpu/guards.rs b/crates/cuda-driver/src/grouped_gu21_gu23_gpu/guards.rs index fe860643..87588edb 100644 --- a/crates/cuda-driver/src/grouped_gu21_gu23_gpu/guards.rs +++ b/crates/cuda-driver/src/grouped_gu21_gu23_gpu/guards.rs @@ -1,8 +1,9 @@ //! Methods of `GuardRig`: `new`, `shape_refusals`, `short_refusals`, `foreign_refusal` and 5 more. //! Functions: `is_finite_words`, `budget_refusal`, `budget_run`, `guards`. Defines `GuardRig`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Device, DeviceBuffer, Error, Result, RoutedFormat, RoutedGateUpQ8, gu_weights, input, read, upload, +}; /// One gate/up format: real owners the refusal checks run against. struct GuardRig<'a> { diff --git a/crates/cuda-driver/src/grouped_gu21_gu23_nc4_gpu/grouped_upload_run.rs b/crates/cuda-driver/src/grouped_gu21_gu23_nc4_gpu/grouped_upload_run.rs index ea4ad515..abf613e5 100644 --- a/crates/cuda-driver/src/grouped_gu21_gu23_nc4_gpu/grouped_upload_run.rs +++ b/crates/cuda-driver/src/grouped_gu21_gu23_nc4_gpu/grouped_upload_run.rs @@ -1,8 +1,10 @@ //! Methods of `GuRig`: `new`, `finish`. Methods of `ScalarBuffers`: `new`, `release`, `column`, `down_columns`. //! Functions: `upload`, `read`, `gu_weights`, `down_weights` and 7 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Comparison, Context, DeviceBuffer, DownColumns, ProjectionKind, ProjectionSpec, Result, RoutedFormat, + RoutedGateUpQ8, +}; pub(super) fn upload<'a>(context: &'a Context<'_>, bytes: &[u8]) -> Result> { let mut buffer = context.allocate(bytes.len())?; diff --git a/crates/cuda-driver/src/grouped_gu21_gu23_nc4_gpu/guards.rs b/crates/cuda-driver/src/grouped_gu21_gu23_nc4_gpu/guards.rs index 557c200c..1d9fb169 100644 --- a/crates/cuda-driver/src/grouped_gu21_gu23_nc4_gpu/guards.rs +++ b/crates/cuda-driver/src/grouped_gu21_gu23_nc4_gpu/guards.rs @@ -1,8 +1,9 @@ //! Methods of `GuardRig`: `new`, `shape_refusals`, `short_refusals`, `foreign_refusal` and 7 more. //! Functions: `is_finite_words`, `close_prepared`, `release_inputs`, `budget_refusal` and 2 more. Defines `GuardRig`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Device, DeviceBuffer, Error, Result, RoutedFormat, RoutedGateUpQ8, gu_weights, input, read, upload, +}; /// One gate/up format: real owners the refusal checks run against. struct GuardRig<'a> { diff --git a/crates/cuda-driver/src/head_greedy.rs b/crates/cuda-driver/src/head_greedy.rs index 54e4f449..816abadd 100644 --- a/crates/cuda-driver/src/head_greedy.rs +++ b/crates/cuda-driver/src/head_greedy.rs @@ -1,5 +1,7 @@ //! Fixed full-vocabulary integer comparison. This is not a model-state capability. -use super::*; +use super::{Context, DeviceBuffer, Error, Rc, Result, combine, ffi}; +#[cfg(test)] +use super::Driver; const WORDS: usize = 248_320; const SOURCE_BYTES: usize = WORDS * 4; diff --git a/crates/cuda-driver/src/iq3_native_integer_mma.rs b/crates/cuda-driver/src/iq3_native_integer_mma.rs index a230395b..1469f8f2 100644 --- a/crates/cuda-driver/src/iq3_native_integer_mma.rs +++ b/crates/cuda-driver/src/iq3_native_integer_mma.rs @@ -1,5 +1,5 @@ //! Unadmitted native IQ3 integer dots + original warp reducer; explicit policy only. -use super::*; +use super::{Context, DeviceBuffer, Error, Layout, QueuedCommand, Result, combine, ffi}; /// 640 rows * 80 actual Q8 groups * 64 tokens * sizeof(i32). pub(super) const CHARGE: usize = 13_107_200; /// Actual root GPU-hidden NVCC 12.8.93 sm_120 asset; explicit experimental policy. diff --git a/crates/cuda-driver/src/kar_decode_levels_gpu/context.rs b/crates/cuda-driver/src/kar_decode_levels_gpu/context.rs index 75eeb133..1cb72921 100644 --- a/crates/cuda-driver/src/kar_decode_levels_gpu/context.rs +++ b/crates/cuda-driver/src/kar_decode_levels_gpu/context.rs @@ -1,8 +1,10 @@ //! Methods of `Context`: `kar_levels_kernels`, `resolve_kar_entries`, `abandon_kar_module`. //! Split out of `kar_decode_levels_gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DriverResult, ENTRY_DECODE, ENTRY_MULTIPLY, ENTRY_SWIGLU, Error, KAR_DECODE_LEVELS_PIN, + KAR_DECODE_LEVELS_PTX, KarDecodeError, KarLevelsKernels, Rc, Result, admit_ptx, combine, failure, ffi, +}; use crate::CurrentGuard; impl Context<'_> { diff --git a/crates/cuda-driver/src/kar_decode_levels_gpu/expert_mlp.rs b/crates/cuda-driver/src/kar_decode_levels_gpu/expert_mlp.rs index 6b611e4a..106e0e07 100644 --- a/crates/cuda-driver/src/kar_decode_levels_gpu/expert_mlp.rs +++ b/crates/cuda-driver/src/kar_decode_levels_gpu/expert_mlp.rs @@ -1,7 +1,9 @@ //! Moved out of kar_decode_levels.rs by the STRA-338 size pass: the single-token routed expert FFN. -#[allow(unused_imports)] -use super::*; +use super::{ + Admitted, BLOCK_THREADS, Context, DeviceBuffer, ExpertShape, KarDecodeError, KarDecodeLevels, KarMatrix, Launch, + MultiplyOperands, Result, STATUS_BYTES, check_status, download, f32_bytes, finite_f32, release_all, +}; /// Byte sizes of the reused scratch of one expert FFN. #[derive(Clone, Copy)] diff --git a/crates/cuda-driver/src/kar_decode_levels_gpu/f32_bytes.rs b/crates/cuda-driver/src/kar_decode_levels_gpu/f32_bytes.rs index 193c6047..183ba00e 100644 --- a/crates/cuda-driver/src/kar_decode_levels_gpu/f32_bytes.rs +++ b/crates/cuda-driver/src/kar_decode_levels_gpu/f32_bytes.rs @@ -1,8 +1,7 @@ //! Functions: `f32_bytes`, `download`, `failure`, `release_all` and 1 more. //! Split out of `kar_decode_levels_gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{DeviceBuffer, DriverResult, Error, KarDecodeError, Result, combine}; pub(super) fn f32_bytes(values: &[f32]) -> Vec { values.iter().flat_map(|v| v.to_le_bytes()).collect() diff --git a/crates/cuda-driver/src/kar_decode_levels_gpu/kar_decode_levels.rs b/crates/cuda-driver/src/kar_decode_levels_gpu/kar_decode_levels.rs index 043f233f..22f4fc70 100644 --- a/crates/cuda-driver/src/kar_decode_levels_gpu/kar_decode_levels.rs +++ b/crates/cuda-driver/src/kar_decode_levels_gpu/kar_decode_levels.rs @@ -1,8 +1,11 @@ //! Methods of `KarDecodeLevels`: `open`, `close`, `admit`, `disjoint` and 15 more. Defines `MultiplyBuffers`. //! Split out of `kar_decode_levels_gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Admitted, BLOCK_THREADS, Context, DecodeGeometry, DecodeMultiplyBuffers, DeviceBuffer, Error, KarDecodeError, + KarDecodeLevels, Launch, MultiplyGeometry, MultiplyOperands, Result, STATUS_BYTES, check_status, download, + f32_bytes, ffi, finite_f32, release_all, +}; impl<'c> KarDecodeLevels<'c> { /// Load (once) and return the cached program. Fails closed with diff --git a/crates/cuda-driver/src/kv_stream_gpu/append_proof.rs b/crates/cuda-driver/src/kv_stream_gpu/append_proof.rs index d9b2ed31..a3271b11 100644 --- a/crates/cuda-driver/src/kv_stream_gpu/append_proof.rs +++ b/crates/cuda-driver/src/kv_stream_gpu/append_proof.rs @@ -1,7 +1,9 @@ //! The INT8 K/V append proof (STRA-338 size pass: moved out of the test function). -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Context, DeviceBuffer, Driver, ImageLayout, KernelShape, Module, NativeBatchWorkspace, PAGE, Rng, addr, + expected, f32s, group, i32s, launch, load, upload, +}; const POS0: usize = 4093; const ROWS: usize = 37; diff --git a/crates/cuda-driver/src/kv_stream_gpu/rng.rs b/crates/cuda-driver/src/kv_stream_gpu/rng.rs index 7c1164c3..f9049b96 100644 --- a/crates/cuda-driver/src/kv_stream_gpu/rng.rs +++ b/crates/cuda-driver/src/kv_stream_gpu/rng.rs @@ -1,8 +1,9 @@ //! Methods of `Rng`: `next`, `unit`, `below`. Functions: `upload`, `addr`, `f32s`, `i32s` and 6 more. //! Defines `KernelShape`, `ImageLayout`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, Context, DeviceBuffer, HD, Module, NativeBatchWorkspace, PAGE, Result, Rng, combine, kv_q8, +}; impl Rng { pub(super) fn next(&mut self) -> u64 { diff --git a/crates/cuda-driver/src/kv_stream_gpu/stream_proof.rs b/crates/cuda-driver/src/kv_stream_gpu/stream_proof.rs index 16902e15..56b7237b 100644 --- a/crates/cuda-driver/src/kv_stream_gpu/stream_proof.rs +++ b/crates/cuda-driver/src/kv_stream_gpu/stream_proof.rs @@ -1,7 +1,10 @@ //! The streamed-vs-resident attention proof (STRA-338 size pass: moved out of the test function). -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, CAP, CHUNK, Context, DeviceBuffer, Driver, HD, HEADS, KernelShape, MappedAllocation, Module, + NativeBatchWorkspace, PAGE, PoolAddresses, Resolver, Rng, SelectedRows, addr, f16_from_f32, f32s, i32s, launch, + load, selection, upload, +}; use crate::OriginalQsaResidentTransport; use std::collections::BTreeSet; diff --git a/crates/cuda-driver/src/mapped_expert_bank/context.rs b/crates/cuda-driver/src/mapped_expert_bank/context.rs index d34fedad..dd6c6446 100644 --- a/crates/cuda-driver/src/mapped_expert_bank/context.rs +++ b/crates/cuda-driver/src/mapped_expert_bank/context.rs @@ -1,8 +1,10 @@ //! Methods of `Context`: `mapped_expert_bank`, `check_bank_inputs`, `bank_ranges`, `bank_role` and 2 more. //! Methods of `MappedExpertBank`: `opened`, `load_banks`. Functions: `aligned_copy_enabled`. -#[allow(unused_imports)] -use super::*; +use super::{ + BANKS, Context, Error, LayerRole, MappedExpertBank, RegisteredBank, ResidentExpertBankLease, + ResidentExpertBankMember, Result, SOURCE_CAP, TensorRole, api, combine, size_of, +}; impl Context<'_> { pub fn mapped_expert_bank<'ctx>( diff --git a/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_drop.rs b/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_drop.rs index 2526f271..9b1a3184 100644 --- a/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_drop.rs +++ b/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_drop.rs @@ -1,8 +1,10 @@ //! Methods of `PendingMappedExpertCopy`: `destination_bytes`, `new`, `observe`, `settle_observation` and 6 more. //! Methods of `Context`: `mapped_expert_copy_scratch`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, MappedExpertBank, MappedExpertCopyCompletion, MappedExpertCopyScratch, + PendingMappedExpertCopy, Rc, ResidentExpertBankSpan, Result, api, combine, size_of, +}; impl Drop for MappedExpertBank<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations.rs b/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations.rs index c398b86f..c8c118b6 100644 --- a/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations.rs +++ b/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations.rs @@ -2,8 +2,10 @@ //! pieces and pinning. //! One impl split over these files so that each stays under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, LayerRole, MappedExpertBank, MappedExpertCopyScratch, PAGE, PendingMappedExpertCopy, + Rc, RegisteredBank, ResidentExpertBankSpan, Result, TensorRole, api, combine, range_covered, size_of, +}; mod mapped_expert_bank_close; mod mapped_expert_bank_pcie_and_triplets; diff --git a/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_close.rs b/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_close.rs index 09796ea4..3f25ce40 100644 --- a/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_close.rs +++ b/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_close.rs @@ -1,8 +1,7 @@ //! Methods of `MappedExpertBank`: `retain_uncertain`, `close`. //! Split out of `mapped_expert_bank_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{MappedExpertBank, Result}; impl<'ctx> MappedExpertBank<'ctx> { pub(in super::super) fn retain_uncertain(&mut self) { diff --git a/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_pcie_and_triplets.rs b/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_pcie_and_triplets.rs index 37550aab..5ff6418e 100644 --- a/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_pcie_and_triplets.rs +++ b/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_pcie_and_triplets.rs @@ -1,8 +1,10 @@ //! Methods of `MappedExpertBank`: `page_locked`, `locked_experts`, `resident_bytes`, `pcie_alias` and 13 more. //! Functions: `bank_index`, `expert_role_offset`. -#[allow(unused_imports)] -use super::*; +use super::{ + DeviceBuffer, Error, LayerRole, MappedExpertBank, MappedExpertCopyScratch, PendingMappedExpertCopy, Rc, + RegisteredBank, ResidentExpertBankSpan, Result, TensorRole, api, combine, range_covered, +}; /// The bank slot (`layer * 3 + role`) of an expert tensor role. fn bank_index(role: TensorRole) -> Result { diff --git a/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_pieces_and_pinning.rs b/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_pieces_and_pinning.rs index 988523e0..e59d5b1b 100644 --- a/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_pieces_and_pinning.rs +++ b/crates/cuda-driver/src/mapped_expert_bank/mapped_expert_bank_operations/mapped_expert_bank_pieces_and_pinning.rs @@ -1,8 +1,10 @@ //! Methods of `MappedExpertBank`: `cache_context_matches`, `cache_source`, `cache_source_aligned`, `retained_span_ha... //! Split out of `mapped_expert_bank_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, LayerRole, MappedExpertBank, PAGE, RegisteredBank, ResidentExpertBankSpan, Result, TensorRole, api, + combine, size_of, +}; impl<'ctx> MappedExpertBank<'ctx> { pub(crate) fn cache_context_matches(&self, context: &Context<'_>) -> bool { diff --git a/crates/cuda-driver/src/mmq.rs b/crates/cuda-driver/src/mmq.rs index 6318abe1..d4a6adbd 100644 --- a/crates/cuda-driver/src/mmq.rs +++ b/crates/cuda-driver/src/mmq.rs @@ -1,5 +1,10 @@ //! Isolated, unadmitted upstream MMQ experiment. No serving dispatcher selects it. -use super::*; +use super::{ + Context, DeviceBuffer, DownColumns, Error, FixedOperation, NativeWeights, ProjectionKind, ProjectionSpec, Result, + RoutedColumnsLoan, RoutedFormat, RoutedGateUpQ8, RoutedGroupWorkspace, combine, ffi, projection_shape, +}; +#[cfg(test)] +use super::{DenseFormat, Device, Driver, qwen_ffi}; #[path = "mmq_original_weights.rs"] mod original_weights; use std::ffi::CStr; diff --git a/crates/cuda-driver/src/mmq/asset.rs b/crates/cuda-driver/src/mmq/asset.rs index 5e96d46f..30763b5d 100644 --- a/crates/cuda-driver/src/mmq/asset.rs +++ b/crates/cuda-driver/src/mmq/asset.rs @@ -1,8 +1,7 @@ //! Methods of `Context`: `mmq_experiment`. //! Functions: `artifacts_valid`, `asset`, `original_formats_asset`, `bytes` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{Context, Error, MmqExperiment, ORIGINAL_FORMATS_FIXUP_PIN, ORIGINAL_FORMATS_MUL_PIN, Result}; const EXPECTED_MUL: [u8; 32] = [ 0x5a, 0x56, 0xd8, 0xeb, 0x66, 0xf1, 0xf9, 0x8e, 0x3c, 0xb3, 0xab, 0x75, 0x18, 0x1e, 0x0f, 0x26, 0x3e, 0x4d, 0x51, diff --git a/crates/cuda-driver/src/mmq/context.rs b/crates/cuda-driver/src/mmq/context.rs index 863507bf..5ea75417 100644 --- a/crates/cuda-driver/src/mmq/context.rs +++ b/crates/cuda-driver/src/mmq/context.rs @@ -1,8 +1,10 @@ //! Methods of `Context`: `mmq_weight_triplet`, `allocate_triplet`, `publish_triplet`, `admit_formats` and 12 more. //! Functions: `check_weight_blocks`, `buffer_handles`, `check_padded_targets`, `owned_gate_up_layout`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, Layout, MmqFormat, MmqWeights, ProjectionKind, ProjectionSpec, Result, RoutedFormat, + bytes, combine, ffi, release_triplet, +}; impl Context<'_> { /// Closed Gate/Up/Down upload. All three immutable owners become usable diff --git a/crates/cuda-driver/src/mmq/experiment_load.rs b/crates/cuda-driver/src/mmq/experiment_load.rs index 29c69926..ef659435 100644 --- a/crates/cuda-driver/src/mmq/experiment_load.rs +++ b/crates/cuda-driver/src/mmq/experiment_load.rs @@ -1,7 +1,6 @@ //! Function-table loading of `MmqExperiment` (STRA-338 size split of `mmq_experiment.rs`). -#[allow(unused_imports)] -use super::*; +use super::{Error, MmqExperiment, MmqFormat, MmqProfile, Result, Tile, TileFunctions, ffi}; impl<'ctx> MmqExperiment<'ctx> { /// Capabilities, the five modules, the native tile functions and fixups, and the activation quantizer. diff --git a/crates/cuda-driver/src/mmq/mmq_experiment.rs b/crates/cuda-driver/src/mmq/mmq_experiment.rs index 24e2cf7d..92fb02f2 100644 --- a/crates/cuda-driver/src/mmq/mmq_experiment.rs +++ b/crates/cuda-driver/src/mmq/mmq_experiment.rs @@ -1,8 +1,10 @@ //! Methods of `MmqExperiment`: `new`, `enable_original_formats`, `function`, `weights` and 16 more. //! Defines `ObservedRun`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, Layout, MmqExperiment, MmqFormat, MmqObservation, MmqProfile, MmqRequest, MmqWeights, + Result, Tile, bytes, combine, ffi, finite_f32, original_formats_asset, +}; /// One observed projection: the weights and output, the layout, the grid (with the stream-k fixup flag) and the /// admitted `[weights, input, output]` handles. diff --git a/crates/cuda-driver/src/mmq/mmq_experiment_drop.rs b/crates/cuda-driver/src/mmq/mmq_experiment_drop.rs index 2db2aeed..867908d9 100644 --- a/crates/cuda-driver/src/mmq/mmq_experiment_drop.rs +++ b/crates/cuda-driver/src/mmq/mmq_experiment_drop.rs @@ -1,8 +1,10 @@ //! Methods of `MmqWeights`: `allocated_bytes`, `native_buffer`, `native_layout`, `native_spec` and 10 more. //! Implements `Drop for MmqExperiment`, `Drop for MmqWeights`. -#[allow(unused_imports)] -use super::*; +use super::{ + DeviceBuffer, DownColumns, Error, Layout, MmqExperiment, MmqFormat, MmqWeights, NativeWeights, ProjectionKind, + ProjectionSpec, Result, RoutedColumnsLoan, RoutedFormat, RoutedGateUpQ8, RoutedGroupWorkspace, +}; impl Drop for MmqExperiment<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/mmq/release_triplet.rs b/crates/cuda-driver/src/mmq/release_triplet.rs index 2fd49596..2d873c3c 100644 --- a/crates/cuda-driver/src/mmq/release_triplet.rs +++ b/crates/cuda-driver/src/mmq/release_triplet.rs @@ -1,8 +1,7 @@ //! Functions: `release_triplet`. //! Split out of `mmq` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, Result}; pub(super) fn release_triplet(context: &Context<'_>, buffers: [Option>; 3]) -> Result<()> { let mut first = Ok(()); diff --git a/crates/cuda-driver/src/mmq/tile.rs b/crates/cuda-driver/src/mmq/tile.rs index bf1c119d..fe4e2c01 100644 --- a/crates/cuda-driver/src/mmq/tile.rs +++ b/crates/cuda-driver/src/mmq/tile.rs @@ -1,8 +1,7 @@ //! Methods of `Tile`: `width`, `index`, `original`. //! Methods of `MmqFormat`: `index`, `entry`, `fixup_entry`, `geometry` and 2 more. -#[allow(unused_imports)] -use super::*; +use super::{CStr, Error, Layout, MmqFormat, MmqProfile, Result, Tile}; /// Original `mul_mat_q` entry symbols by `MmqFormat::index()` row and `Tile::index()` column. const MMQ_ENTRIES: [[&CStr; 7]; 6] = [ diff --git a/crates/cuda-driver/src/mmq_ffi.rs b/crates/cuda-driver/src/mmq_ffi.rs index 2904e917..2dbe9709 100644 --- a/crates/cuda-driver/src/mmq_ffi.rs +++ b/crates/cuda-driver/src/mmq_ffi.rs @@ -1,5 +1,5 @@ //! Closed ABI storage for immutable upstream MMQ entries; owned through sync. -use super::*; +use super::BufferHandle; use crate::mmq::Layout; use std::ffi::c_void; #[repr(C)] diff --git a/crates/cuda-driver/src/mmq_ffi/mmq_original_gather_arguments.rs b/crates/cuda-driver/src/mmq_ffi/mmq_original_gather_arguments.rs index af8f2d8c..e292e5d8 100644 --- a/crates/cuda-driver/src/mmq_ffi/mmq_original_gather_arguments.rs +++ b/crates/cuda-driver/src/mmq_ffi/mmq_original_gather_arguments.rs @@ -1,8 +1,7 @@ //! Methods of `MmqOriginalGatherArguments`: `new`, `parameters`. //! Split out of `mmq_abi` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{BufferHandle, MmqOriginalGatherArguments, Owned, c_void}; impl MmqOriginalGatherArguments { pub(crate) fn new( diff --git a/crates/cuda-driver/src/mmq_ffi/mmq_resident_arguments.rs b/crates/cuda-driver/src/mmq_ffi/mmq_resident_arguments.rs index 3bd4ea58..dad15f8e 100644 --- a/crates/cuda-driver/src/mmq_ffi/mmq_resident_arguments.rs +++ b/crates/cuda-driver/src/mmq_ffi/mmq_resident_arguments.rs @@ -1,8 +1,11 @@ //! Methods of `MmqResidentArguments`: `native_resident_d4`, `zero`, `finite`, `gather` and 1 more. //! Methods of `Iq3NativeIntegerArguments`: `dot`, `reduce`, `new`, `parameters`. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Iq3NativeIntegerArguments, Layout, MmqArguments, MmqFixupArguments, MmqGatherShape, MmqGroupBuffers, + MmqGroupRouting, MmqGroupShape, MmqOriginalSwigluArguments, MmqQuantArguments, MmqResidentArguments, Owned, c_void, + fastdiv, +}; impl MmqResidentArguments { pub(crate) fn native_resident_d4( diff --git a/crates/cuda-driver/src/mmq_ffi/owned.rs b/crates/cuda-driver/src/mmq_ffi/owned.rs index 165d18f2..b80469b7 100644 --- a/crates/cuda-driver/src/mmq_ffi/owned.rs +++ b/crates/cuda-driver/src/mmq_ffi/owned.rs @@ -1,8 +1,7 @@ //! Methods of `Owned`: `new`, `parameters`. Methods of `MmqQuantArguments`: `new`, `parameters`. //! Implements `Drop for Owned`. Functions: `fastdiv`. -#[allow(unused_imports)] -use super::*; +use super::{BufferHandle, Layout, MmqArguments, MmqFixupArguments, MmqQuantArguments, Owned, Storage, c_void}; impl Owned { pub(super) fn new() -> Self { diff --git a/crates/cuda-driver/src/mmq_native.rs b/crates/cuda-driver/src/mmq_native.rs index f21a73c9..54452303 100644 --- a/crates/cuda-driver/src/mmq_native.rs +++ b/crates/cuda-driver/src/mmq_native.rs @@ -1,5 +1,5 @@ //! Producer-certified logical native weight span without a fabricated buffer view. -use super::*; +use super::{DeviceBuffer, Error, ProjectionSpec, Result, mmq}; pub(crate) enum NativeWeights<'borrow, 'ctx> { Raw(&'borrow DeviceBuffer<'ctx>), Dual(&'borrow mmq::MmqWeights<'ctx>), diff --git a/crates/cuda-driver/src/mmq_native_activation.rs b/crates/cuda-driver/src/mmq_native_activation.rs index 8334cd46..8d4fbe19 100644 --- a/crates/cuda-driver/src/mmq_native_activation.rs +++ b/crates/cuda-driver/src/mmq_native_activation.rs @@ -1,5 +1,5 @@ //! Explicit native-activation policy; original D4 producer remains unchanged. -use super::*; +use super::{Context, DeviceBuffer, Error, FixedOperation, Layout, QueuedCommand, Result, combine, ffi}; pub(super) const CHARGE: usize = 184320; pub(crate) fn asset() -> Result<&'static [u8]> { let b = include_bytes!("mmq_native_resident_d4.ptx"); diff --git a/crates/cuda-driver/src/mmq_native_down.rs b/crates/cuda-driver/src/mmq_native_down.rs index 2d177044..1a3406b0 100644 --- a/crates/cuda-driver/src/mmq_native_down.rs +++ b/crates/cuda-driver/src/mmq_native_down.rs @@ -1,6 +1,9 @@ //! IntegerIQ3 policy only: preserve the original Down20/42 emitted arithmetic. //! Reuse actual native Q8_1 already produced from this owned hidden lease. -use super::*; +use super::{ + DOWN, DeviceBuffer, Error, FixedOperation, MmqFormat, MmqWeights, MmqWorkspace, NativeWeights, ProjectionKind, + ProjectionSpec, QueuedCommand, Result, RoutedFormat, combine, commands, ffi, projection_shape, +}; impl MmqWorkspace<'_> { pub(super) fn project_native_down(&self, weights: &MmqWeights<'_>, tokens: u32) -> Result<()> { diff --git a/crates/cuda-driver/src/mmq_native_resident_gpu/digest.rs b/crates/cuda-driver/src/mmq_native_resident_gpu/digest.rs index eee36594..43d68c51 100644 --- a/crates/cuda-driver/src/mmq_native_resident_gpu/digest.rs +++ b/crates/cuda-driver/src/mmq_native_resident_gpu/digest.rs @@ -1,8 +1,9 @@ //! Functions: `digest`, `read`, `parse_pins`, `read_pinned` and 10 more. //! Split out of `mmq_native_resident_gpu_tests` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + BTreeMap, Context, DeviceBuffer, MetadataExt, OpenOptions, OpenOptionsExt, Path, PathBuf, Read, Write, finite_f32, +}; pub(super) fn digest(b: &[u8]) -> String { use std::fmt::Write; diff --git a/crates/cuda-driver/src/mmq_native_resident_gpu/native_hidden_q8.rs b/crates/cuda-driver/src/mmq_native_resident_gpu/native_hidden_q8.rs index b94c434b..aaa08cb5 100644 --- a/crates/cuda-driver/src/mmq_native_resident_gpu/native_hidden_q8.rs +++ b/crates/cuda-driver/src/mmq_native_resident_gpu/native_hidden_q8.rs @@ -1,8 +1,7 @@ //! Implements `Drop for Alias`. Functions: `native_hidden_q8`. //! Split out of `mmq_native_resident_gpu_tests` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Alias, CHUNK, Context, DeviceBuffer, FixedOperation, download, ffi}; // The original CommonQuantize kernel, independently invoked on a real native hidden row. pub(super) fn native_hidden_q8(context: &Context<'_>, input: &DeviceBuffer<'_>) -> Vec { diff --git a/crates/cuda-driver/src/mmq_numeric_gpu/digest.rs b/crates/cuda-driver/src/mmq_numeric_gpu/digest.rs index b2a8ef2e..380736e0 100644 --- a/crates/cuda-driver/src/mmq_numeric_gpu/digest.rs +++ b/crates/cuda-driver/src/mmq_numeric_gpu/digest.rs @@ -1,8 +1,10 @@ //! Methods of `Receipt`: `load`, `read`. Functions: `digest`, `hex`, `read_regular`, `parse_manifest` and 7 more. //! Defines `Manifest`. -#[allow(unused_imports)] -use super::*; +use super::{ + BTreeMap, CASE_FILES, Component, MetadataExt, OpenOptions, OpenOptionsExt, Path, PathBuf, Pin, Read, Receipt, + SOURCE_SHA, UPSTREAM, qwen_ffi, +}; pub(super) fn digest(bytes: &[u8]) -> String { use std::fmt::Write; diff --git a/crates/cuda-driver/src/mmq_numeric_gpu/format_cases.rs b/crates/cuda-driver/src/mmq_numeric_gpu/format_cases.rs index d9c54d15..483ec40f 100644 --- a/crates/cuda-driver/src/mmq_numeric_gpu/format_cases.rs +++ b/crates/cuda-driver/src/mmq_numeric_gpu/format_cases.rs @@ -1,8 +1,7 @@ //! Functions: `cases`, `load_case`, `check_metadata`, `check_geometry`. Defines `Shape`. //! Split out of `mmq_numeric_gpu_tests` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Case, Receipt, field, finite, integer}; /// (kind, rows, columns, raw weight bytes, zero tail bytes) of one format. type Shape = (u32, usize, usize, usize, usize); diff --git a/crates/cuda-driver/src/mmq_original_chunk_stream/chunk_issuing.rs b/crates/cuda-driver/src/mmq_original_chunk_stream/chunk_issuing.rs index 111c15e2..52d3efb0 100644 --- a/crates/cuda-driver/src/mmq_original_chunk_stream/chunk_issuing.rs +++ b/crates/cuda-driver/src/mmq_original_chunk_stream/chunk_issuing.rs @@ -2,8 +2,7 @@ //! copies, with jitter and piece splitting. //! Apart from the chunk stream's types in `chunk_stream`. -#[allow(unused_imports)] -use super::*; +use super::{ACTIVE, Core, Duration, Entry, Error, Instant, Ordering, Result}; impl Core { pub(super) fn ring(&self) -> usize { diff --git a/crates/cuda-driver/src/mmq_original_chunk_stream/chunk_stream.rs b/crates/cuda-driver/src/mmq_original_chunk_stream/chunk_stream.rs index 20fee83c..3c56f1c8 100644 --- a/crates/cuda-driver/src/mmq_original_chunk_stream/chunk_stream.rs +++ b/crates/cuda-driver/src/mmq_original_chunk_stream/chunk_stream.rs @@ -1,8 +1,10 @@ //! Methods of `Stats`: `new`. Methods of `Core`: `new`. Implements `Drop for ChunkStream`. Functions: `env_number`. //! Defines `CoreParts`. -#[allow(unused_imports)] -use super::*; +use super::{ + ACTIVE, Api, Arc, AtomicBool, AtomicU64, AtomicUsize, BufferHandle, ChunkStream, Core, Entry, Error, Ordering, + Result, Stats, +}; fn env_number(name: &str) -> Option { crate::settings::var(name).ok().and_then(|v| v.trim().parse::().ok()) diff --git a/crates/cuda-driver/src/mmq_original_group.rs b/crates/cuda-driver/src/mmq_original_group.rs index 25c36ec1..4925d030 100644 --- a/crates/cuda-driver/src/mmq_original_group.rs +++ b/crates/cuda-driver/src/mmq_original_group.rs @@ -1,6 +1,11 @@ //! Literal Original prompt Product grouping. Affine layer -> staged group -> //! finite Down owner; no external ready bit or borrowed fabricated weight view. -use super::*; +use super::{ + Context, DeviceBuffer, Error, Layout, MmqFormat, MmqWorkspace, QueuedCommand, Result, STATUS, bytes, combine, + commands, ffi, +}; +#[cfg(test)] +use super::Driver; const X: usize = 0; const ROW_IDS: usize = 1; const IDENTITY: usize = 2; diff --git a/crates/cuda-driver/src/mmq_original_group/asset.rs b/crates/cuda-driver/src/mmq_original_group/asset.rs index fcad283c..8989b0d1 100644 --- a/crates/cuda-driver/src/mmq_original_group/asset.rs +++ b/crates/cuda-driver/src/mmq_original_group/asset.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalGroupBank`: `new`, `admit_charge`, `init`, `load_guarded` and 9 more. //! Implements `Drop for OriginalGroupBank`. Functions: `asset`, `sizes`, `original_mmq_group_bank_bytes`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, FORMATS, MmqFormat, OriginalGroupBank, Result, SEALED, TMP, WIDTHS, combine, ffi, + kind, shared, +}; pub(crate) fn asset(kind: u32) -> Result<&'static [u8]> { let bytes: &[u8] = match kind { diff --git a/crates/cuda-driver/src/mmq_original_group/copy_ring_layer.rs b/crates/cuda-driver/src/mmq_original_group/copy_ring_layer.rs index 860a1c88..05c4146c 100644 --- a/crates/cuda-driver/src/mmq_original_group/copy_ring_layer.rs +++ b/crates/cuda-driver/src/mmq_original_group/copy_ring_layer.rs @@ -1,7 +1,10 @@ //! Methods of `OriginalMmqLayer`: `execute_original_copy_ring`, `copy_ring_preflight`, `copy_ring_same_spans`, `stre... -#[allow(unused_imports)] -use super::*; +use super::{ + BOUNDS, D, Error, GU, GatherDest, GroupArena, H, HQ, IDENTITY, Layout, MmqFormat, OriginalGroupBank, + OriginalMmqCopySchedule, OriginalMmqLayer, ProjectSlots, ProjectSpec, Result, RingExperts, TMP, WD, WG, WIDTHS, XQ, + combine, copy_ring, ffi, format_index, layout, +}; impl<'layer, 'ctx> OriginalMmqLayer<'layer, 'ctx> { /// Execute the actual ascending expert layer through Original's copy ring. diff --git a/crates/cuda-driver/src/mmq_original_group/kind.rs b/crates/cuda-driver/src/mmq_original_group/kind.rs index caf7d27e..7fc7dbdf 100644 --- a/crates/cuda-driver/src/mmq_original_group/kind.rs +++ b/crates/cuda-driver/src/mmq_original_group/kind.rs @@ -1,8 +1,10 @@ //! Methods of `Context`: `native_integer_iq3_mmq_original_grouped_workspace`. //! Implements `GroupArena for OriginalDeviceGrRead`. Functions: `kind`, `shared`, `format_index`, `layout` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{ + BOUNDS, Context, D, Error, FORMATS, GU, GroupArena, H, HQ, IDENTITY, Layout, MmqFormat, MmqWorkspace, + OriginalGroupBank, ROW_IDS, Result, WD, WG, X, XQ, asset, combine, ffi, +}; pub(super) fn kind(f: MmqFormat) -> u32 { match f { diff --git a/crates/cuda-driver/src/mmq_original_group/mmq_workspace.rs b/crates/cuda-driver/src/mmq_original_group/mmq_workspace.rs index 0020aecd..13d5c18c 100644 --- a/crates/cuda-driver/src/mmq_original_group/mmq_workspace.rs +++ b/crates/cuda-driver/src/mmq_original_group/mmq_workspace.rs @@ -1,8 +1,10 @@ //! Methods of `MmqWorkspace`: `enable_original_expert_groups`, `enable_original_expert_group_arena`, `original_exper... //! Methods of `RoutePlan`: `new`. -#[allow(unused_imports)] -use super::*; +use super::{ + BOUNDS, Error, GroupArena, IDENTITY, MmqWorkspace, OriginalGroupBank, OriginalMmqLayer, QuantizeSlots, ROW_IDS, + Result, X, XQ, bytes, combine, ffi, +}; impl<'ctx> MmqWorkspace<'ctx> { /// Explicit eager selected-factory admission; never silently replaces a bank. diff --git a/crates/cuda-driver/src/mmq_original_group/original_mmq_layer.rs b/crates/cuda-driver/src/mmq_original_group/original_mmq_layer.rs index 1bc21ece..64a9cabe 100644 --- a/crates/cuda-driver/src/mmq_original_group/original_mmq_layer.rs +++ b/crates/cuda-driver/src/mmq_original_group/original_mmq_layer.rs @@ -1,8 +1,11 @@ //! Groups the submodules `finite_and_quantize`, `group_projection`, `original_mmq_layer_stage_experts`. //! Split out of `original_group` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + BOUNDS, D, DeviceBuffer, Error, FORMATS, FiniteScan, GU, H, HQ, IDENTITY, Layout, MmqFormat, OriginalGroupBank, + OriginalMmqLayer, OriginalMmqOutput, ProjectSlots, ProjectSpec, QuantizeSlots, QueuedCommand, ROW_IDS, Result, + STATUS, TMP, WD, WG, WIDTHS, XQ, commands, ffi, format_index, kind, layout, +}; #[path = "original_mmq_layer/finite_and_quantize.rs"] mod finite_and_quantize; diff --git a/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/finite_and_quantize.rs b/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/finite_and_quantize.rs index 88eb57ce..5197a587 100644 --- a/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/finite_and_quantize.rs +++ b/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/finite_and_quantize.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalMmqLayer`: `bank`, `span`, `handle`, `reject_arena_alias` and 10 more. //! Split out of `original_mmq_layer` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + D, DeviceBuffer, Error, FORMATS, FiniteScan, H, MmqFormat, OriginalGroupBank, OriginalMmqLayer, QuantizeSlots, + QueuedCommand, ROW_IDS, Result, STATUS, TMP, WD, WG, XQ, commands, ffi, layout, +}; impl<'layer, 'ctx> OriginalMmqLayer<'layer, 'ctx> { pub(in super::super) fn bank(&self) -> Result<&OriginalGroupBank<'ctx>> { diff --git a/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/group_projection.rs b/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/group_projection.rs index 33769659..e3b201b4 100644 --- a/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/group_projection.rs +++ b/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/group_projection.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMmqLayer`: `project`, `project_plan`, `project_kernels`, `project_grid` and 11 more. //! Defines `ProjectPlan`, `ProjectHandles`. -#[allow(unused_imports)] -use super::*; +use super::{ + BOUNDS, D, Error, FiniteScan, GU, H, HQ, IDENTITY, Layout, MmqFormat, OriginalGroupBank, OriginalMmqLayer, + OriginalMmqOutput, ProjectSlots, ProjectSpec, QuantizeSlots, QueuedCommand, Result, STATUS, TMP, WD, WG, WIDTHS, + XQ, commands, ffi, format_index, layout, +}; /// What `project` decided before touching any buffer. pub(crate) struct ProjectPlan { diff --git a/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/original_mmq_layer_stage_experts.rs b/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/original_mmq_layer_stage_experts.rs index 0f82f588..b144167c 100644 --- a/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/original_mmq_layer_stage_experts.rs +++ b/crates/cuda-driver/src/mmq_original_group/original_mmq_layer/original_mmq_layer_stage_experts.rs @@ -1,8 +1,9 @@ //! Methods of `OriginalMmqLayer`: `stage_raw`, `stage_slots`, `raw_amount`, `check_raw_handles` and 4 more. //! Split out of `original_mmq_layer` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, MmqFormat, OriginalGroupBank, OriginalMmqLayer, QueuedCommand, Result, WD, WG, commands, ffi, kind, +}; impl<'layer, 'ctx> OriginalMmqLayer<'layer, 'ctx> { pub(in super::super) fn stage_raw(&mut self, formats: [MmqFormat; 3], raw: [ffi::BufferHandle; 3]) -> Result<()> { diff --git a/crates/cuda-driver/src/mmq_original_group/original_mmq_output.rs b/crates/cuda-driver/src/mmq_original_group/original_mmq_output.rs index 69e2b88a..5a3d5ef0 100644 --- a/crates/cuda-driver/src/mmq_original_group/original_mmq_output.rs +++ b/crates/cuda-driver/src/mmq_original_group/original_mmq_output.rs @@ -1,8 +1,9 @@ //! Methods of `OriginalMmqOutput`: `copy_group_down_to_prompt`, `check_arena_destination`, `copy_expert_down_columns... //! Methods of `OriginalMmqLayer`: `group_down_spans`, `down_column_handles`, `check_down_destination`, `reject_down_... -#[allow(unused_imports)] -use super::*; +use super::{ + Context, D, DeviceBuffer, Error, OriginalGroupBank, OriginalMmqLayer, OriginalMmqOutput, Result, combine, ffi, +}; impl OriginalMmqOutput<'_, '_, '_> { /// Copy the complete finite group contiguously into Original's expert-order diff --git a/crates/cuda-driver/src/mmq_original_host_stage/host_stage.rs b/crates/cuda-driver/src/mmq_original_host_stage/host_stage.rs index 7fb8b62b..1bbf10c5 100644 --- a/crates/cuda-driver/src/mmq_original_host_stage/host_stage.rs +++ b/crates/cuda-driver/src/mmq_original_host_stage/host_stage.rs @@ -1,8 +1,10 @@ //! Methods of `HostStage`: `new`, `stager_sizes`, `unstarted`, `allocate_ring` and 13 more. //! Implements `Drop for HostStage`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arc, AtomicU32, AtomicU64, AtomicUsize, Condvar, Error, HostStage, Job, MAX_JOBS, Mutex, NON_FINITE, Ordering, + Result, Shared, Wake, api, thread, verify_enabled, +}; impl HostStage { /// `ring` page-locked buffers of `buffer_bytes`, `threads` helpers (prefill.cpp: 4 threads and 16 buffers, diff --git a/crates/cuda-driver/src/mmq_original_host_stage/verify_enabled.rs b/crates/cuda-driver/src/mmq_original_host_stage/verify_enabled.rs index 25237038..ca0dbc0a 100644 --- a/crates/cuda-driver/src/mmq_original_host_stage/verify_enabled.rs +++ b/crates/cuda-driver/src/mmq_original_host_stage/verify_enabled.rs @@ -1,8 +1,10 @@ //! Methods of `Shared`: `claim`, `finished`, `work`, `await_jobs` and 4 more. //! Functions: `verify_enabled`, `layer_priority`, `apply_priority`, `block_bytes` and 1 more. +use super::{Arc, Job, NON_FINITE, NORMAL_PRIORITY, Ordering, Shared, thread}; +// used only with some cargo features or targets of this crate #[allow(unused_imports)] -use super::*; +use super::{LAYERS, LOW_PRIORITY}; /// Bring-up: `LELEKA_BRINGUP_TRACE` and `LELEKA_STAGE_VERIFY` compare every staged buffer with its source when its DMA /// is released. diff --git a/crates/cuda-driver/src/mmq_original_ring.rs b/crates/cuda-driver/src/mmq_original_ring.rs index 9e1b1573..4e5c9baf 100644 --- a/crates/cuda-driver/src/mmq_original_ring.rs +++ b/crates/cuda-driver/src/mmq_original_ring.rs @@ -1,6 +1,6 @@ //! Literal Original ordinary-walk copy ring, prefill.cpp1693–1830. The actual //! arena row loan, registered source bank and all stable ABI owners outlive work. -use super::*; +use super::{Context, DeviceBuffer, Error, FORMATS, GroupArena, MmqFormat, Result, TMP, combine, ffi, kind}; use crate::ffi::original_enqueue::{Api, Command}; use crate::original_gpu_schedule::{OriginalEventKind, OriginalGpuEvent, OriginalGpuStream, OriginalStreamKind}; use leleka_model_format::qwen4exp::{ResidentExpertBankSpan, TensorRole}; diff --git a/crates/cuda-driver/src/mmq_original_ring/original_mmq_copy_schedule.rs b/crates/cuda-driver/src/mmq_original_ring/original_mmq_copy_schedule.rs index 4d0cd9b3..53ebbddc 100644 --- a/crates/cuda-driver/src/mmq_original_ring/original_mmq_copy_schedule.rs +++ b/crates/cuda-driver/src/mmq_original_ring/original_mmq_copy_schedule.rs @@ -1,8 +1,13 @@ //! Methods of `OriginalMmqCopySchedule`: `retain_host_metadata_charge`, `ring_slots`, `prompt_stream_active`, `begin... //! Split out of `copy_ring` to keep its files under the line limit. +use super::{Context, Error, Events, OriginalGpuStream, OriginalMmqCopySchedule, Rc, Result, combine}; +#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))] +use super::{StreamEntry, chunk_stream}; +use super::ChunkStream; +// used only with some cargo features or targets of this crate #[allow(unused_imports)] -use super::*; +use super::ffi; #[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))] mod stream_start; diff --git a/crates/cuda-driver/src/mmq_original_ring/original_mmq_copy_schedule_drop.rs b/crates/cuda-driver/src/mmq_original_ring/original_mmq_copy_schedule_drop.rs index ec805e7b..ceb06900 100644 --- a/crates/cuda-driver/src/mmq_original_ring/original_mmq_copy_schedule_drop.rs +++ b/crates/cuda-driver/src/mmq_original_ring/original_mmq_copy_schedule_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for OriginalMmqCopySchedule`. //! Split out of `copy_ring` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::OriginalMmqCopySchedule; impl Drop for OriginalMmqCopySchedule<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/mmq_original_ring/ring.rs b/crates/cuda-driver/src/mmq_original_ring/ring.rs index 6ed17752..bd6c7096 100644 --- a/crates/cuda-driver/src/mmq_original_ring/ring.rs +++ b/crates/cuda-driver/src/mmq_original_ring/ring.rs @@ -1,8 +1,12 @@ //! Groups the submodules `ring_construction`, `ring_gather_and_finish`, `ring_init` and 2 more. //! Split out of `copy_ring` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, COMMAND_CAP, Command, Context, DeviceBuffer, Drain, Error, FORMATS, GatherDest, GroupArena, HostStage, Job, + MmqFormat, OriginalEventKind, OriginalGpuEvent, OriginalGpuStream, OriginalMmqCopySchedule, Rc, + ResidentExpertBankSpan, Result, Ring, RingArena, RingExperts, Slot, Source, TMP, TensorRole, combine, ffi, + host_stage, kind, serialize_ring, skip_expert_dma, +}; #[path = "ring/ring_construction.rs"] mod ring_construction; diff --git a/crates/cuda-driver/src/mmq_original_ring/ring/ring_construction.rs b/crates/cuda-driver/src/mmq_original_ring/ring/ring_construction.rs index d85badc4..f5f2ecb9 100644 --- a/crates/cuda-driver/src/mmq_original_ring/ring/ring_construction.rs +++ b/crates/cuda-driver/src/mmq_original_ring/ring/ring_construction.rs @@ -1,8 +1,7 @@ //! Methods of `Ring`: `new`, `admitted_slots`. Functions: `schedule_serves_ring`. //! Split out of `ring` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, Error, OriginalMmqCopySchedule, Result, Ring, RingArena, RingExperts, RingPlan, combine}; /// Whether a schedule that owns `schedule_slots` slot events serves an arena ring of `arena_slots` slots. The /// schedule is opened once with the full prompt layout's ring (384 slots). A smaller arena of the prompt loan ladder diff --git a/crates/cuda-driver/src/mmq_original_ring/ring/ring_gather_and_finish.rs b/crates/cuda-driver/src/mmq_original_ring/ring/ring_gather_and_finish.rs index 394b0ff9..5c31e8ea 100644 --- a/crates/cuda-driver/src/mmq_original_ring/ring/ring_gather_and_finish.rs +++ b/crates/cuda-driver/src/mmq_original_ring/ring/ring_gather_and_finish.rs @@ -1,8 +1,7 @@ //! Methods of `Ring`: `gather`, `gather_streamed`, `gather_slot`, `check_gather_destination` and 10 more. //! Split out of `ring` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Command, DeviceBuffer, Error, GatherDest, MmqFormat, OriginalGpuStream, Result, Ring, combine, ffi}; use crate::ring_prefetch::RingRefusal; impl<'read, 'ctx> Ring<'read, 'ctx> { diff --git a/crates/cuda-driver/src/mmq_original_ring/ring/ring_prefetch.rs b/crates/cuda-driver/src/mmq_original_ring/ring/ring_prefetch.rs index 5d852281..b91e30fb 100644 --- a/crates/cuda-driver/src/mmq_original_ring/ring/ring_prefetch.rs +++ b/crates/cuda-driver/src/mmq_original_ring/ring/ring_prefetch.rs @@ -4,8 +4,7 @@ //! the same bytes; only the time of its copy changes. use super::super::ring_prefetch_issue::{PendingPrefetch, PrefetchEntry}; -#[allow(unused_imports)] -use super::*; +use super::{Error, OriginalMmqCopySchedule, Rc, ResidentExpertBankSpan, Result, Ring, RingPlan, Slot, ffi}; use crate::ring_prefetch::{self, ExpertMask, RingRefusal, SlotState, mask_set, match_prefetch}; /// `(address, length)` of the gate, up and down host ranges: the identity of the bytes a copy moved. diff --git a/crates/cuda-driver/src/mmq_original_ring/ring/ring_stage_expert_copies.rs b/crates/cuda-driver/src/mmq_original_ring/ring/ring_stage_expert_copies.rs index 971b32db..9eab7ce1 100644 --- a/crates/cuda-driver/src/mmq_original_ring/ring/ring_stage_expert_copies.rs +++ b/crates/cuda-driver/src/mmq_original_ring/ring/ring_stage_expert_copies.rs @@ -1,8 +1,10 @@ //! Methods of `Ring`: `metadata_bytes`, `enqueue`, `flag`, `stage_one` and 10 more. Functions: `profile_copied`. //! Split out of `ring` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, COMMAND_CAP, Command, Drain, Error, MmqFormat, OriginalGpuEvent, OriginalGpuStream, ResidentExpertBankSpan, + Result, Ring, Slot, Source, ffi, serialize_ring, skip_expert_dma, +}; impl<'read, 'ctx> Ring<'read, 'ctx> { pub(in super::super::super) fn metadata_bytes(&self) -> Result { diff --git a/crates/cuda-driver/src/mmq_original_ring/ring_drop.rs b/crates/cuda-driver/src/mmq_original_ring/ring_drop.rs index 297b8ecc..fd81ee7e 100644 --- a/crates/cuda-driver/src/mmq_original_ring/ring_drop.rs +++ b/crates/cuda-driver/src/mmq_original_ring/ring_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for Ring`. //! Split out of `copy_ring` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::Ring; impl Drop for Ring<'_, '_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/mmq_original_ring/ring_init.rs b/crates/cuda-driver/src/mmq_original_ring/ring_init.rs index 8399377b..db63dd40 100644 --- a/crates/cuda-driver/src/mmq_original_ring/ring_init.rs +++ b/crates/cuda-driver/src/mmq_original_ring/ring_init.rs @@ -1,8 +1,11 @@ //! Construction phases of `Ring::new`, split out by STRA-338 (size). Every phase keeps the original statement //! order and error handling; `Ring::init` runs them in the order the former closure ran them. -#[allow(unused_imports)] -use super::*; +use super::{ + COMMAND_CAP, Context, DeviceBuffer, Error, FORMATS, GroupArena, HostStage, Job, MmqFormat, OriginalEventKind, + OriginalMmqCopySchedule, Rc, ResidentExpertBankSpan, Result, Ring, Slot, Source, TMP, TensorRole, ffi, host_stage, + kind, +}; /// Layer-wide numbers every construction phase needs. pub(in super::super) struct RingPlan { diff --git a/crates/cuda-driver/src/mmq_original_ring/ring_prefetch_issue.rs b/crates/cuda-driver/src/mmq_original_ring/ring_prefetch_issue.rs index e9b97744..1e5f0159 100644 --- a/crates/cuda-driver/src/mmq_original_ring/ring_prefetch_issue.rs +++ b/crates/cuda-driver/src/mmq_original_ring/ring_prefetch_issue.rs @@ -5,8 +5,10 @@ //! from the engine's settings; nothing here reads the environment. use super::ring::{RingPlan, profile_prefetch}; -#[allow(unused_imports)] -use super::*; +use super::{ + Error, FORMATS, GroupArena, MmqFormat, OriginalGpuStream, OriginalMmqCopySchedule, Rc, ResidentExpertBankSpan, + Result, Ring, TMP, ffi, skip_expert_dma, +}; use crate::ring_prefetch::{MissHistory, RingPrefetchPolicy}; /// One expert copied ahead into a stage slot. diff --git a/crates/cuda-driver/src/mmq_original_ring/skip_expert_dma.rs b/crates/cuda-driver/src/mmq_original_ring/skip_expert_dma.rs index fda2d85b..165a0e48 100644 --- a/crates/cuda-driver/src/mmq_original_ring/skip_expert_dma.rs +++ b/crates/cuda-driver/src/mmq_original_ring/skip_expert_dma.rs @@ -1,8 +1,10 @@ //! Methods of `ChunkStream`: `entry`, `next_layer_is`, `entry_matches`, `acquire` and 3 more. //! Methods of `Drain`: `index`. Implements `RingArena for OriginalDeviceGrRead`. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, Context, Drain, Error, Events, OriginalEventKind, OriginalMmqCopySchedule, OriginalStreamKind, Rc, Result, + RingArena, RingPrefetch, combine, ffi, +}; /// `LELEKA_PREFILL_DIAG_SKIP_EXPERT_DMA=1` (EXPERIMENTAL, diagnostic, wrong outputs): the copy ring issues no /// expert copies, so a profile shows the ring's compute alone. Never set in serving. diff --git a/crates/cuda-driver/src/mmq_original_ring/stream_start.rs b/crates/cuda-driver/src/mmq_original_ring/stream_start.rs index faf97557..72a1efaf 100644 --- a/crates/cuda-driver/src/mmq_original_ring/stream_start.rs +++ b/crates/cuda-driver/src/mmq_original_ring/stream_start.rs @@ -1,7 +1,6 @@ //! Prompt-stream start of `OriginalMmqCopySchedule` (STRA-338 size split of `original_mmq_copy_schedule.rs`). -#[allow(unused_imports)] -use super::*; +use super::{ChunkStream, Error, OriginalMmqCopySchedule, Rc, Result, StreamEntry, chunk_stream, combine, ffi}; /// What the prompt stream copies: the first layer, the ring size, the entries in stream order and the ring slots. pub(super) struct StreamPlan { diff --git a/crates/cuda-driver/src/mmq_original_stream_all.rs b/crates/cuda-driver/src/mmq_original_stream_all.rs index 781355d4..0a882aab 100644 --- a/crates/cuda-driver/src/mmq_original_stream_all.rs +++ b/crates/cuda-driver/src/mmq_original_stream_all.rs @@ -1,7 +1,11 @@ //! Closed actual persistent MMQ bank producer for the global Original issuer. //! Raw Stage members are read only by gather; copied group storage is then the //! sole weight source. Every owned command/status survives the provided stream. -use super::*; +use super::{ + BOUNDS, Context, D, DeviceBuffer, Error, FORMATS, GU, H, HQ, IDENTITY, MmqFormat, OriginalGroupBank, + OriginalMmqLayer, OriginalStreamAllLayer, ProjectSlots, ProjectSpec, ROW_IDS, Result, TMP, WD, WG, X, XQ, combine, + ffi, layout, +}; use crate::ffi::original_enqueue::{Api, Command}; use crate::original_expert_stager::{ OriginalStreamAllGatheredGroup, OriginalStreamAllGroupProducer, OriginalStreamAllMember, diff --git a/crates/cuda-driver/src/mmq_original_stream_all/group_producer_gather_project.rs b/crates/cuda-driver/src/mmq_original_stream_all/group_producer_gather_project.rs index dcd1b0e3..49a97474 100644 --- a/crates/cuda-driver/src/mmq_original_stream_all/group_producer_gather_project.rs +++ b/crates/cuda-driver/src/mmq_original_stream_all/group_producer_gather_project.rs @@ -1,8 +1,11 @@ //! Methods of `Producer`: `rejects_context`, `rejects_state`, `check_spans`, `check_formats` and 5 more. //! Implements `OriginalStreamAllGroupProducer for Producer`. -#[allow(unused_imports)] -use super::*; +use super::{ + BOUNDS, Command, Context, D, Error, FORMATS, GU, H, HQ, IDENTITY, OriginalGpuStream, + OriginalStreamAllGatheredGroup, OriginalStreamAllGroupProducer, OriginalStreamAllMember, Producer, ROW_IDS, Result, + TMP, WD, WG, X, XQ, ffi, +}; impl<'ctx> OriginalStreamAllGroupProducer<'ctx> for Producer<'_, '_, 'ctx> { fn validate( diff --git a/crates/cuda-driver/src/mmq_original_stream_all/original_mmq_layer.rs b/crates/cuda-driver/src/mmq_original_stream_all/original_mmq_layer.rs index bf1acf08..4bdc3c6c 100644 --- a/crates/cuda-driver/src/mmq_original_stream_all/original_mmq_layer.rs +++ b/crates/cuda-driver/src/mmq_original_stream_all/original_mmq_layer.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalMmqLayer`: `enqueue_global_group`, `enqueue_zeroes`, `enqueue_hidden_checks`, `enqueue_hidden... //! Split out of `stream_all_mmq` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Command, D, Error, GU, H, HQ, MmqFormat, OriginalGpuStream, OriginalGroupBank, OriginalMmqLayer, + OriginalStreamAllLayer, Producer, ProjectSlots, ProjectSpec, Result, Transport, WD, WG, XQ, combine, ffi, layout, +}; impl<'layer, 'ctx> OriginalMmqLayer<'layer, 'ctx> { pub(super) fn enqueue_global_group( diff --git a/crates/cuda-driver/src/mmq_original_stream_all/transport.rs b/crates/cuda-driver/src/mmq_original_stream_all/transport.rs index 7df61bcd..bb1ec6a8 100644 --- a/crates/cuda-driver/src/mmq_original_stream_all/transport.rs +++ b/crates/cuda-driver/src/mmq_original_stream_all/transport.rs @@ -1,8 +1,10 @@ //! Methods of `Transport`: `new`, `reserve_host`, `check_host_budget`, `check_device_budget` and 5 more. //! Implements `Drop for Transport`, `Drop for Producer`. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, COMMAND_CAP, Command, Context, DeviceBuffer, Error, OriginalGpuStream, Producer, Result, Transport, combine, + ffi, +}; impl<'ctx> Transport<'ctx> { pub(super) fn new(context: &'ctx Context<'ctx>, groups: usize, host_allowance: usize) -> Result { diff --git a/crates/cuda-driver/src/mmq_original_weights.rs b/crates/cuda-driver/src/mmq_original_weights.rs index 505b72cd..472301ce 100644 --- a/crates/cuda-driver/src/mmq_original_weights.rs +++ b/crates/cuda-driver/src/mmq_original_weights.rs @@ -1,7 +1,7 @@ //! Actual Original prompt-only whole three-weight upload. //! The existing closed triplet producer is retained; this separate constructor //! admits the actual additional Original GU formats without changing old APIs. -use super::*; +use super::{Context, DeviceBuffer, Error, Layout, MmqFormat, MmqWeights, Result, bytes, combine, release_triplet}; impl Context<'_> { pub fn mmq_original_weight_triplet(&self, formats: [MmqFormat; 3], raw: [&[u8]; 3]) -> Result<[MmqWeights<'_>; 3]> { if self.is_poisoned() || self.handle.is_none() { diff --git a/crates/cuda-driver/src/mmq_resident.rs b/crates/cuda-driver/src/mmq_resident.rs index ca7931d5..c66b6d4f 100644 --- a/crates/cuda-driver/src/mmq_resident.rs +++ b/crates/cuda-driver/src/mmq_resident.rs @@ -1,5 +1,11 @@ //! Exclusive resident transport. Every proof owns its actual workspace lease. -use super::*; +use super::{ + Context, DeviceBuffer, Error, FixedOperation, Layout, MmqExperiment, MmqFormat, MmqProfile, MmqWeights, + NativeWeights, ProjectionKind, ProjectionSpec, Result, RoutedFormat, bytes, combine, ffi, original_formats_asset, + projection_shape, +}; +#[cfg(test)] +use super::{Device, DownColumns, Driver, MmqRequest, finite_f32, qwen_ffi}; #[path = "mmq_native_activation.rs"] pub(crate) mod native_activation; #[path = "mmq_native_down.rs"] diff --git a/crates/cuda-driver/src/mmq_resident/asset.rs b/crates/cuda-driver/src/mmq_resident/asset.rs index 8cf1d5ed..48b2fac1 100644 --- a/crates/cuda-driver/src/mmq_resident/asset.rs +++ b/crates/cuda-driver/src/mmq_resident/asset.rs @@ -1,8 +1,7 @@ //! Methods of `QueuedCommand`: `launch`, `launch_projection`. //! Methods of `Context`: `mmq_workspace`, `native_mmq_workspace`, `native_integer_iq3_mmq_workspace`, `native_intege... -#[allow(unused_imports)] -use super::*; +use super::{Context, Error, MmqWorkspace, QueuedCommand, Result, combine, original_formats_asset}; // PTX is supplied only by ROOT's pinned GPU-hidden compiler. No placeholder artifact. pub(crate) fn asset() -> Result<&'static [u8]> { diff --git a/crates/cuda-driver/src/mmq_resident/mmq_workspace.rs b/crates/cuda-driver/src/mmq_resident/mmq_workspace.rs index 71c83d29..5e9a2eaa 100644 --- a/crates/cuda-driver/src/mmq_resident/mmq_workspace.rs +++ b/crates/cuda-driver/src/mmq_resident/mmq_workspace.rs @@ -1,8 +1,11 @@ //! Groups the submodules `mmq_workspace_bring_up`, `mmq_workspace_gate_up_chunk_close`, `projection_plan`. //! Split out of `resident` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + CHUNK, Context, DOWN, DeviceBuffer, Error, GATE, GROUP, HIDDEN, INPUT, Layout, MmqChunkActivation, MmqExperiment, + MmqFormat, MmqProfile, MmqWeights, MmqWorkspace, ProjectionSlots, QueuedCommand, Result, SCRATCH, STATUS, UP, + bytes, combine, commands, ffi, native_activation, native_integer, +}; #[path = "mmq_workspace/mmq_workspace_bring_up.rs"] mod mmq_workspace_bring_up; diff --git a/crates/cuda-driver/src/mmq_resident/mmq_workspace/mmq_workspace_bring_up.rs b/crates/cuda-driver/src/mmq_resident/mmq_workspace/mmq_workspace_bring_up.rs index 1483220c..006b1bc1 100644 --- a/crates/cuda-driver/src/mmq_resident/mmq_workspace/mmq_workspace_bring_up.rs +++ b/crates/cuda-driver/src/mmq_resident/mmq_workspace/mmq_workspace_bring_up.rs @@ -1,8 +1,12 @@ //! Methods of `MmqWorkspace`: `new`, `check_integer_policy`, `charge`, `bring_up` and 13 more. //! Split out of `mmq_workspace` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, MmqWorkspace, QueuedCommand, Result, bytes, combine, ffi, native_activation, + native_integer, +}; +#[cfg(test)] +use super::commands; impl<'ctx> MmqWorkspace<'ctx> { pub(in super::super) fn new( diff --git a/crates/cuda-driver/src/mmq_resident/mmq_workspace/mmq_workspace_gate_up_chunk_close.rs b/crates/cuda-driver/src/mmq_resident/mmq_workspace/mmq_workspace_gate_up_chunk_close.rs index c31c27d0..247f5fc8 100644 --- a/crates/cuda-driver/src/mmq_resident/mmq_workspace/mmq_workspace_gate_up_chunk_close.rs +++ b/crates/cuda-driver/src/mmq_resident/mmq_workspace/mmq_workspace_gate_up_chunk_close.rs @@ -1,8 +1,7 @@ //! Methods of `MmqWorkspace`: `prepare_original_gate_up_chunk`, `prepare_gate_up_chunk_with_operator`, `upload_and_q... //! Split out of `mmq_workspace` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{CHUNK, Error, INPUT, Layout, MmqChunkActivation, MmqFormat, MmqWorkspace, Result, bytes, combine}; impl<'ctx> MmqWorkspace<'ctx> { /// Mint an affine Original-prompt activation using the actual D4 quantizer, diff --git a/crates/cuda-driver/src/mmq_resident/mmq_workspace/projection_plan.rs b/crates/cuda-driver/src/mmq_resident/mmq_workspace/projection_plan.rs index a700d485..c28a5808 100644 --- a/crates/cuda-driver/src/mmq_resident/mmq_workspace/projection_plan.rs +++ b/crates/cuda-driver/src/mmq_resident/mmq_workspace/projection_plan.rs @@ -1,8 +1,11 @@ //! Methods of `MmqWorkspace`: `finish_finite`, `finite`, `quantize`, `quantize_with_operator` and 15 more. //! Functions: `finite_extent`, `finite_verdict`, `finite_output_name`. Defines `StreamKLaunch`, `ProjectPlan`. -#[allow(unused_imports)] -use super::*; +use super::{ + DOWN, Error, GATE, GROUP, HIDDEN, Layout, MmqChunkActivation, MmqExperiment, MmqFormat, MmqProfile, MmqWeights, + MmqWorkspace, ProjectionSlots, QueuedCommand, Result, SCRATCH, STATUS, UP, commands, ffi, native_activation, + native_integer, +}; impl<'ctx> MmqWorkspace<'ctx> { pub(in super::super) fn finish_finite( diff --git a/crates/cuda-driver/src/mmq_resident/mmq_workspace_drop.rs b/crates/cuda-driver/src/mmq_resident/mmq_workspace_drop.rs index 0ba6fea3..87dfdd5f 100644 --- a/crates/cuda-driver/src/mmq_resident/mmq_workspace_drop.rs +++ b/crates/cuda-driver/src/mmq_resident/mmq_workspace_drop.rs @@ -1,8 +1,11 @@ //! Methods of `MmqChunkActivation`: `gather_gate_up`, `gather_group`, `upload_gather_ids`, `gather_handles`. //! Methods of `MmqGroupActivation`: `admits`, `gate_up`, `project_swiglu`, `swiglu_hidden` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{ + CHUNK, DOWN, DOWN_Q8, DeviceBuffer, DownCopyHandles, Error, FiniteMmqOutput, FixedOperation, GATE, GROUP, HIDDEN, + IDS, Layout, MmqChunkActivation, MmqFormat, MmqGroupActivation, MmqHidden, MmqWeights, MmqWorkspace, + ProjectionSlots, QueuedCommand, Result, UP, combine, commands, ffi, +}; impl Drop for MmqWorkspace<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/mmq_resident_gpu/digest.rs b/crates/cuda-driver/src/mmq_resident_gpu/digest.rs index 9d0dbc16..8d80eb19 100644 --- a/crates/cuda-driver/src/mmq_resident_gpu/digest.rs +++ b/crates/cuda-driver/src/mmq_resident_gpu/digest.rs @@ -1,8 +1,10 @@ //! Methods of `Receipt`: `load`, `check_pinned_contents`, `read`. //! Functions: `digest`, `hex`, `read_regular`, `parse_manifest` and 14 more. -#[allow(unused_imports)] -use super::*; +use super::{ + BTreeMap, CASE_FILES, Component, Context, DeviceBuffer, MetadataExt, MmqFormat, OpenOptions, OpenOptionsExt, Path, + PathBuf, Pin, Read, Receipt, RoutedFormat, SOURCE_SHA, UPSTREAM, qwen_ffi, +}; pub(super) fn digest(bytes: &[u8]) -> String { use std::fmt::Write; diff --git a/crates/cuda-driver/src/mmq_resident_gpu/live_packet_alias_drop.rs b/crates/cuda-driver/src/mmq_resident_gpu/live_packet_alias_drop.rs index f0c77503..4c27b7a1 100644 --- a/crates/cuda-driver/src/mmq_resident_gpu/live_packet_alias_drop.rs +++ b/crates/cuda-driver/src/mmq_resident_gpu/live_packet_alias_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for LivePacketAlias`. //! Split out of `mmq_resident_gpu_tests` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::LivePacketAlias; impl Drop for LivePacketAlias<'_, '_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/mmq_resident_gpu/native_owner.rs b/crates/cuda-driver/src/mmq_resident_gpu/native_owner.rs index 867e5fb1..95a392ce 100644 --- a/crates/cuda-driver/src/mmq_resident_gpu/native_owner.rs +++ b/crates/cuda-driver/src/mmq_resident_gpu/native_owner.rs @@ -1,8 +1,10 @@ //! Functions: `native_owner`, `native_gate_up_owner`, `native_down_owner`, `direct` and 2 more. //! Split out of `mmq_resident_gpu_tests` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + CHUNK, Context, DOWN, DeviceBuffer, DownColumns, Error, GATE, GROUP, INPUT, MmqWeights, MmqWorkspace, Receipt, + download, file, finite, floats, integer, raw_format, same, upload, +}; pub(super) fn native_owner(c: &Context<'_>, dual: &MmqWeights<'_>, raw: &[u8], data: &[u8]) { let spec = dual.native_spec(); diff --git a/crates/cuda-driver/src/mmq_resident_gpu/owner_proof.rs b/crates/cuda-driver/src/mmq_resident_gpu/owner_proof.rs index 8201b077..5fb9d2ae 100644 --- a/crates/cuda-driver/src/mmq_resident_gpu/owner_proof.rs +++ b/crates/cuda-driver/src/mmq_resident_gpu/owner_proof.rs @@ -1,7 +1,9 @@ //! Phases of the resident chain/gather/dual-native proof, split out of the test entry by STRA-338. -#[allow(unused_imports)] -use super::*; +use super::{ + BUDGET, CHUNK, Context, Driver, Error, GATE, MmqFormat, MmqWeights, MmqWorkspace, PathBuf, ROOT_REFERENCE_SHA, + Receipt, chain, direct, download, file, floats, gather, native_owner, same, witness, +}; pub(super) type ProofFormats = [(u32, MmqFormat, u32); 4]; diff --git a/crates/cuda-driver/src/mmq_resident_gpu/queued_proof.rs b/crates/cuda-driver/src/mmq_resident_gpu/queued_proof.rs index caa0efe6..23f669be 100644 --- a/crates/cuda-driver/src/mmq_resident_gpu/queued_proof.rs +++ b/crates/cuda-driver/src/mmq_resident_gpu/queued_proof.rs @@ -1,7 +1,10 @@ //! Phases of the queued finite chain / bulk Down packet proof, split out of the test entry by STRA-338. -#[allow(unused_imports)] -use super::*; +use super::{ + CHUNK, Context, DOWN, DOWN_Q8, DeviceBuffer, Error, FiniteMmqOutput, GATE, GROUP, HIDDEN, INPUT, LivePacketAlias, + MmqHidden, MmqProfile, MmqRequest, MmqWeights, MmqWorkspace, Receipt, UP, compare, download, encoded, file, finite, + floats, integer, same, upload, +}; const QT: u32 = 4; const GU_BYTES: usize = 4 * 2560; diff --git a/crates/cuda-driver/src/mmq_resident_gpu/resident_chain.rs b/crates/cuda-driver/src/mmq_resident_gpu/resident_chain.rs index 8b290776..0f2abf10 100644 --- a/crates/cuda-driver/src/mmq_resident_gpu/resident_chain.rs +++ b/crates/cuda-driver/src/mmq_resident_gpu/resident_chain.rs @@ -1,8 +1,11 @@ //! Methods of `LivePacketAlias`: `new`, `buffer`. //! Functions: `chain_baseline`, `chain`, `chain_hidden_checks`, `chain_slot_checks` and 8 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DOWN, DeviceBuffer, Error, FiniteMmqOutput, GATE, GROUP, HIDDEN, LivePacketAlias, MmqHidden, MmqProfile, + MmqRequest, MmqWeights, MmqWorkspace, Receipt, STATUS, UP, compare, download, encoded, file, finite, floats, same, + upload, +}; /// Original-first nonresident values the resident chain must reproduce. struct ChainBaseline { diff --git a/crates/cuda-driver/src/moe_group_down_columns.rs b/crates/cuda-driver/src/moe_group_down_columns.rs index d1737893..209b2bcd 100644 --- a/crates/cuda-driver/src/moe_group_down_columns.rs +++ b/crates/cuda-driver/src/moe_group_down_columns.rs @@ -1,5 +1,8 @@ //! Closed grouped native SwiGLU/Down20/42; each column retains scalar arithmetic. -use super::*; +use super::{ + Context, DeviceBuffer, Error, FixedKernel, FixedOperation, NativeWeights, ProjectionKind, ProjectionSpec, Result, + RoutedFormat, combine, ffi, projection_ranges, projection_shape, +}; type NativeDownCopyHandles = (ffi::BufferHandle, ffi::BufferHandle, ffi::BufferHandle); /// The number of columns and the routed format of one grouped Down projection. #[derive(Clone, Copy)] diff --git a/crates/cuda-driver/src/moe_group_projection.rs b/crates/cuda-driver/src/moe_group_projection.rs index 01fa8313..72c01527 100644 --- a/crates/cuda-driver/src/moe_group_projection.rs +++ b/crates/cuda-driver/src/moe_group_projection.rs @@ -1,5 +1,21 @@ //! Closed genuine grouped-column GU18/GU22 and experimental GU21/GU23 projections; scalar arithmetic unchanged. -use super::*; +use super::{ + Context, DeviceBuffer, Error, FixedOperation, NativeWeights, ProjectionKind, ProjectionSpec, Result, RoutedFormat, + RoutedGateUpQ8, combine, ffi, projection_shape, +}; +#[cfg(test)] +use super::{ + Bf16ProjectionShape, Cell, DenseFormat, Device, DownColumns, Driver, KV_RESIDENT_DEFAULT_CELLS, + KV_RESIDENT_MIN_CELLS, MAX_CONTEXT_CELLS, OriginalGraphResources, OriginalHostKv, OriginalMtpCapture, + OriginalMtpCoupledPlan, OriginalMtpKvFormat, OriginalMtpKvMode, OriginalMtpKvPlan, OriginalMtpKvStartup, + OriginalMtpLoadPlan, OriginalMtpPlanError, OriginalMtpWeightBankPlan, OriginalSessionBytes, OriginalSessionControl, + PhantomData, Q5KProjectionShape, Q6KProjectionShape, Rc, RefCell, ServingContext, TRAINED_CONTEXT_CELLS, + bringup_trace_enabled, context, +}; +#[cfg(all(test, all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64", feature = "cuda-driver")))] +use super::{GdnGemm, GrBatchModule}; +#[cfg(all(test, all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64")))] +use super::{OriginalNativeHeadGraphResources, OriginalVerifyGraphResources, OriginalVerifyWindowOps}; impl Context<'_> { pub fn project_routed_gate_up_columns( &self, diff --git a/crates/cuda-driver/src/moe_prefill_batch.rs b/crates/cuda-driver/src/moe_prefill_batch.rs index edf272b2..9bf0eee8 100644 --- a/crates/cuda-driver/src/moe_prefill_batch.rs +++ b/crates/cuda-driver/src/moe_prefill_batch.rs @@ -17,7 +17,7 @@ //! launch and before any D2H, earliest-stage refusal, completion uncertainty poisons the context and leaks the owners. //! The route ids/weights reach the host only after a clean complete drain. use super::gdn_native_batch::{GdnGemm, GdnNativeFormat, GdnStream, GemmShape, Kernel as DequantKernel}; -use super::*; +use super::{Context, DeviceBuffer, Error, Result, combine, ffi}; /// Most rows of one window (the closed adapters' micro-window bound). pub const MOE_BATCH_MAX_TOKENS: usize = 64; diff --git a/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix.rs b/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix.rs index df515f50..f8d3fa6a 100644 --- a/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix.rs +++ b/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix.rs @@ -1,8 +1,12 @@ //! Groups the submodules `combine_stage`, `moe_batch_prefix_router_pack`, `shared_expert_projections`. //! Split out of `moe_prefill_batch` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Command, Context, DeviceBuffer, Drained, EXPERTS, Error, F16, F32, FF, GdnNativeFormat, GemmShape, + MoeBatchCompletion, MoeBatchPrefix, MoeBatchStage, MoeCombineInputs, MoeKernel, MoeRouteBatch, N, Result, Role, + SELECTED, SLOT_BYTES, STATUS_BYTES, Step, check_slot_map, combine, decode_statuses, ffi, format_index, linear, + staging, words, +}; #[path = "moe_batch_prefix/combine_stage.rs"] mod combine_stage; diff --git a/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/combine_stage.rs b/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/combine_stage.rs index 754984f2..e27f5118 100644 --- a/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/combine_stage.rs +++ b/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/combine_stage.rs @@ -1,8 +1,11 @@ //! Methods of `MoeBatchPrefix`: `combine_from`, `combine_body`, `combine_inputs`, `upload_slot_map` and 8 more. //! Methods of `DrainStaging`: `new`. Defines `DrainStaging`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Drained, EXPERTS, Error, F32, MoeBatchCompletion, MoeBatchPrefix, MoeBatchStage, + MoeCombineInputs, MoeKernel, MoeRouteBatch, N, Result, Role, SELECTED, SLOT_BYTES, STATUS_BYTES, Step, + check_slot_map, combine, decode_statuses, ffi, linear, staging, words, +}; impl<'lease, 'ctx> MoeBatchPrefix<'lease, 'ctx> { /// The combine-only program's single step (`begin_combine`): the same `moe_combine` over the caller-lent diff --git a/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/moe_batch_prefix_router_pack.rs b/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/moe_batch_prefix_router_pack.rs index e34d8568..f5927882 100644 --- a/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/moe_batch_prefix_router_pack.rs +++ b/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/moe_batch_prefix_router_pack.rs @@ -1,8 +1,10 @@ //! Methods of `MoeBatchPrefix`: `tokens`, `ready`, `latch`, `moe_function` and 13 more. //! Functions: `bind_size_admitted`. -#[allow(unused_imports)] -use super::*; +use super::{ + Command, DeviceBuffer, EXPERTS, Error, F16, F32, GemmShape, MoeBatchPrefix, MoeBatchStage, MoeKernel, N, Result, + Role, SELECTED, STATUS_BYTES, Step, ffi, linear, +}; impl<'lease, 'ctx> MoeBatchPrefix<'lease, 'ctx> { pub fn tokens(&self) -> usize { diff --git a/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/shared_expert_projections.rs b/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/shared_expert_projections.rs index f5703232..4926988d 100644 --- a/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/shared_expert_projections.rs +++ b/crates/cuda-driver/src/moe_prefill_batch/moe_batch_prefix/shared_expert_projections.rs @@ -1,8 +1,10 @@ //! Methods of `MoeBatchPrefix`: `project_native`, `push_dequant`, `shared_gate`, `shared_up` and 4 more. //! Defines `NativeProjection`, `ProjectionOperands`. -#[allow(unused_imports)] -use super::*; +use super::{ + Command, DeviceBuffer, Error, F16, F32, FF, GdnNativeFormat, GemmShape, MoeBatchPrefix, MoeBatchStage, MoeKernel, + N, Result, Role, Step, ffi, format_index, linear, +}; /// The shape of one native projection: the GGUF `format`, the matrix `rows` x `depth` and the byte size of the f32 /// output. diff --git a/crates/cuda-driver/src/moe_prefill_batch/moe_prefill_batch_lifecycle.rs b/crates/cuda-driver/src/moe_prefill_batch/moe_prefill_batch_lifecycle.rs index 1cb3695c..71db4a89 100644 --- a/crates/cuda-driver/src/moe_prefill_batch/moe_prefill_batch_lifecycle.rs +++ b/crates/cuda-driver/src/moe_prefill_batch/moe_prefill_batch_lifecycle.rs @@ -2,8 +2,11 @@ //! `Command`. //! Apart from `moe_prefill_batch.rs`, which holds the types and fields. -#[allow(unused_imports)] -use super::*; +use super::{ + Bindings, Command, Context, DEQUANTS, Error, Functions, GdnGemm, GdnStream, MOE_BATCH_MAX_TOKENS, MOE_KERNELS, + MoeBatchCompletion, MoeBatchPrefix, MoeBatchStage, MoeKernel, MoePrefillBatch, MoeRouteBatch, Result, SLOT_BYTES, + SLOTS, STATUS_BYTES, Step, combine, ffi, linear, +}; impl<'ctx> MoePrefillBatch<'ctx> { pub(super) fn new(context: &'ctx Context<'ctx>) -> Result { diff --git a/crates/cuda-driver/src/moe_prefill_batch/pinned.rs b/crates/cuda-driver/src/moe_prefill_batch/pinned.rs index 6908eca9..ba66e9e5 100644 --- a/crates/cuda-driver/src/moe_prefill_batch/pinned.rs +++ b/crates/cuda-driver/src/moe_prefill_batch/pinned.rs @@ -1,8 +1,10 @@ //! Methods of `MoeKernel`: `entry`, `index`. Methods of `MoeBatchStage`: `slot`, `elements`, `is_half`, `bytes`. //! Functions: `pinned`, `prefill_asset`, `format_index`, `linear` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Bindings, Context, EXPERTS, Error, F16, F32, FF, GdnNativeFormat, MOE_PTX_LEN, MOE_PTX_SHA256, MoeBatchStage, + MoeKernel, MoePrefillBatch, N, ROLES, Result, Role, SELECTED, SLOTS, STAGES, STATUS_BYTES, Step, ffi, +}; pub(super) fn pinned(ptx: &'static [u8], len: usize, digest: [u8; 32]) -> Result<&'static [u8]> { if ptx.last() != Some(&0) || !ptx[..ptx.len() - 1].is_ascii() || ptx[..ptx.len() - 1].contains(&0) { diff --git a/crates/cuda-driver/src/moe_prefill_batch/words.rs b/crates/cuda-driver/src/moe_prefill_batch/words.rs index ca29c5e1..ebeb807d 100644 --- a/crates/cuda-driver/src/moe_prefill_batch/words.rs +++ b/crates/cuda-driver/src/moe_prefill_batch/words.rs @@ -1,8 +1,7 @@ //! Methods of `MoePrefillBatch`: `close_inner`, `retire_buffer`, `retire_module`. //! Implements `Drop for MoePrefillBatch`. Functions: `words`, `check_slot_map`, `staging`. -#[allow(unused_imports)] -use super::*; +use super::{DeviceBuffer, Error, MOE_BATCH_MAX_TOKENS, MoePrefillBatch, Result, SELECTED, combine, ffi}; pub(super) fn words(bytes: &[u8], decode: fn([u8; 4]) -> T) -> Result> { let mut values = Vec::new(); diff --git a/crates/cuda-driver/src/moe_prefill_batch_gpu/bytes_of.rs b/crates/cuda-driver/src/moe_prefill_batch_gpu/bytes_of.rs index 0e6e8973..d232f7d4 100644 --- a/crates/cuda-driver/src/moe_prefill_batch_gpu/bytes_of.rs +++ b/crates/cuda-driver/src/moe_prefill_batch_gpu/bytes_of.rs @@ -1,8 +1,9 @@ //! Methods of `HostGemm`: `run`, `poison_output`. Implements `GdnGemm for HostGemm`. //! Functions: `bytes_of`, `words_of`, `halves_of`, `f16_bits` and 13 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, EXPERTS, Error, GdnGemm, GdnStream, GemmShape, HostGemm, Q8_0_BLOCK, Result, combine, +}; // ---------------------------------------------------------------- host numerics helpers pub(super) fn bytes_of(values: &[f32]) -> Vec { diff --git a/crates/cuda-driver/src/moe_prefill_batch_gpu/clean_window_check.rs b/crates/cuda-driver/src/moe_prefill_batch_gpu/clean_window_check.rs index 07d34cdb..d17a28ee 100644 --- a/crates/cuda-driver/src/moe_prefill_batch_gpu/clean_window_check.rs +++ b/crates/cuda-driver/src/moe_prefill_batch_gpu/clean_window_check.rs @@ -1,8 +1,10 @@ //! Functions: `check_clean`, `check_down_reads_h`, `check_dequantized_scratch`, `check_mixed_images` and 5 more. //! Split out of `gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Captured, EXPERTS, Error, FF, Fixture, HostGemm, MoeRouteBatch, N, Result, SELECTED, Window, bf_bits, bf_value, + close, f16_bits, f16_value, halves_of, mismatch, q8_0, read, sigm, words_of, +}; pub(super) fn check_clean( f: &Fixture<'_>, diff --git a/crates/cuda-driver/src/moe_prefill_batch_gpu/fixture.rs b/crates/cuda-driver/src/moe_prefill_batch_gpu/fixture.rs index eb797cca..09a00613 100644 --- a/crates/cuda-driver/src/moe_prefill_batch_gpu/fixture.rs +++ b/crates/cuda-driver/src/moe_prefill_batch_gpu/fixture.rs @@ -1,8 +1,11 @@ //! Methods of `Fixture`: `new`, `release`. Methods of `Images`: `new`. //! Functions: `blank`, `bf16_matrix`, `run_case`, `run_window` and 1 more. Defines `Window`. -#[allow(unused_imports)] -use super::*; +use super::{ + Captured, Cell, Context, DeviceBuffer, EXPERTS, Error, Experts, FF, Fixture, GdnNativeFormat, HostGemm, Images, + MOE_BATCH_SCRATCH_BYTES, MoeBatchPrefix, MoeBatchStage, MoePrefillBatch, N, Poison, Products, RefCell, Result, + Routing, SELECTED, bf_bits, bytes_of, check_clean, combine, mismatch, pattern, q8_0, upload, +}; fn blank<'a>(context: &'a Context<'_>, bytes: usize) -> Result> { upload(context, &vec![0; bytes]) diff --git a/crates/cuda-driver/src/moe_prefill_batch_gpu/program_cases.rs b/crates/cuda-driver/src/moe_prefill_batch_gpu/program_cases.rs index 87ad0243..c7f6bd49 100644 --- a/crates/cuda-driver/src/moe_prefill_batch_gpu/program_cases.rs +++ b/crates/cuda-driver/src/moe_prefill_batch_gpu/program_cases.rs @@ -1,7 +1,9 @@ //! The whole-program case list of the MoE prefill smoke, split out of the test entry by STRA-338. -#[allow(unused_imports)] -use super::*; +use super::{ + Captured, Cell, Context, HostGemm, MOE_BATCH_MAX_TOKENS, MoeBatchStage, MoePrefillBatch, Poison, RefCell, Result, + SLOT_BYTES, STATUS_BYTES, Window, mismatch, run_case, +}; pub(super) fn run_program_cases(context: &Context<'_>) -> Result<()> { let mut batch = context.moe_prefill_batch()?; diff --git a/crates/cuda-driver/src/mtp_input_workspace.rs b/crates/cuda-driver/src/mtp_input_workspace.rs index be1ffd17..61df5298 100644 --- a/crates/cuda-driver/src/mtp_input_workspace.rs +++ b/crates/cuda-driver/src/mtp_input_workspace.rs @@ -1,6 +1,9 @@ //! Closed original MTP input branch. Only admitted stages enter this queue. //! The runtime retains genuine frame/role/source checks at their original seams. -use super::*; +use super::{ + Admission, Arguments, Context, DeviceBuffer, Error, Operation, Result, admission, combine, ffi, qwen_ffi, + registered, +}; use crate::{DenseFormat, ProjectionKind, ProjectionSpec, projection_ranges, projection_shape}; const SIZES: [usize; 9] = [10240, 40960, 10240, 10240, 40960, 40960, 40960, 2880, 52]; diff --git a/crates/cuda-driver/src/mtp_input_workspace/mtp_input_completion.rs b/crates/cuda-driver/src/mtp_input_workspace/mtp_input_completion.rs index 3c060455..d688b093 100644 --- a/crates/cuda-driver/src/mtp_input_workspace/mtp_input_completion.rs +++ b/crates/cuda-driver/src/mtp_input_workspace/mtp_input_completion.rs @@ -1,8 +1,11 @@ //! Methods of `MtpInputCompletion`: `numerical_refusal`, `refusal_stage`, `into_streams`. //! Methods of `Context`: `mtp_input_workspace`. Functions: `qwen_functions`, `stage_inputs`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DenseFormat, DeviceBuffer, Error, Kernels, MtpInputCompletion, MtpInputPrefix, MtpInputRefusal, + MtpInputWorkspace, OPERATIONS, ProjectionKind, RESERVE, Result, SIZES, TOTAL, combine, ffi, qwen_ffi, registered, + staging, +}; impl MtpInputCompletion<'_, '_> { pub fn numerical_refusal(&self) -> Option { diff --git a/crates/cuda-driver/src/mtp_input_workspace/mtp_input_prefix.rs b/crates/cuda-driver/src/mtp_input_workspace/mtp_input_prefix.rs index 7f228a35..de912931 100644 --- a/crates/cuda-driver/src/mtp_input_workspace/mtp_input_prefix.rs +++ b/crates/cuda-driver/src/mtp_input_workspace/mtp_input_prefix.rs @@ -1,8 +1,11 @@ //! Methods of `MtpInputPrefix`: `weight`, `ready`, `latch`, `status` and 14 more. Methods of `DrainStaging`: `new`. //! Functions: `first_refusal`, `queue_qwen`, `square_shape`. Defines `DrainStaging`. -#[allow(unused_imports)] -use super::*; +use super::{ + Admission, Arguments, Command, Context, DenseFormat, DeviceBuffer, Drained, Error, MtpInputCompletion, + MtpInputPrefix, MtpInputRefusal, MtpInputWorkspace, OPERATIONS, ProjectionKind, ProjectionSpec, QUANT, Result, + SIZES, STAGES, admission, combine, ffi, projection_ranges, projection_shape, qwen_ffi, staging, +}; impl<'lease, 'ctx> MtpInputPrefix<'lease, 'ctx> { pub(super) fn weight(&self, weight: &DeviceBuffer<'_>, bytes: usize) -> Result { diff --git a/crates/cuda-driver/src/mtp_input_workspace/mtp_input_workspace_lifecycle.rs b/crates/cuda-driver/src/mtp_input_workspace/mtp_input_workspace_lifecycle.rs index 8d4be369..fdede904 100644 --- a/crates/cuda-driver/src/mtp_input_workspace/mtp_input_workspace_lifecycle.rs +++ b/crates/cuda-driver/src/mtp_input_workspace/mtp_input_workspace_lifecycle.rs @@ -2,8 +2,7 @@ //! the `Command` launch. //! Apart from `mtp_input_workspace.rs`, which holds the types and fields. -#[allow(unused_imports)] -use super::*; +use super::{Command, Context, DeviceBuffer, Error, MtpInputWorkspace, Result, combine, ffi}; impl MtpInputWorkspace<'_> { pub(super) fn close_inner(&mut self) -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_input_workspace_gpu/bytes.rs b/crates/cuda-driver/src/mtp_input_workspace_gpu/bytes.rs index a8d6d1bb..f89112d9 100644 --- a/crates/cuda-driver/src/mtp_input_workspace_gpu/bytes.rs +++ b/crates/cuda-driver/src/mtp_input_workspace_gpu/bytes.rs @@ -1,8 +1,10 @@ //! Functions: `bytes`, `upload`, `read`, `full_finite` and 13 more. Defines `Step`. //! Split out of `gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DenseFormat, DeviceBuffer, Error, MtpInputCompletion, MtpInputRefusal, MtpInputWorkspace, Numeric, + Observed, ProjectionKind, ProjectionSpec, Report, Result, STAGES, combine, +}; pub(super) fn bytes(values: &[f32]) -> Vec { values.iter().flat_map(|v| v.to_le_bytes()).collect() diff --git a/crates/cuda-driver/src/mtp_input_workspace_gpu/numeric_case.rs b/crates/cuda-driver/src/mtp_input_workspace_gpu/numeric_case.rs index 60a85ea1..fc6fdb12 100644 --- a/crates/cuda-driver/src/mtp_input_workspace_gpu/numeric_case.rs +++ b/crates/cuda-driver/src/mtp_input_workspace_gpu/numeric_case.rs @@ -1,8 +1,10 @@ //! Functions: `numeric_case`, `run`, `run_cases`, `upload_corpus` and 5 more. //! Split out of `gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, MtpInputRefusal, MtpInputWorkspace, Numeric, Report, Result, STAGES, TOTAL, bytes, + combine, finite_case, inputs, original, queue, raw, refuse, upload, +}; pub(super) fn numeric_case( workspace: &mut MtpInputWorkspace<'_>, diff --git a/crates/cuda-driver/src/mtp_original_check_batch_program.rs b/crates/cuda-driver/src/mtp_original_check_batch_program.rs index 717df39d..824dcd2c 100644 --- a/crates/cuda-driver/src/mtp_original_check_batch_program.rs +++ b/crates/cuda-driver/src/mtp_original_check_batch_program.rs @@ -5,8 +5,12 @@ //! //! Only checks that are neighbours in the list are grouped, so no check moves across another command. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, Context, Error, F, FA, FM, FullCommand, LaunchShape, Module, Rc, Result, ScalarCommand, combine, + symbols, +}; +#[cfg(test)] +use super::TAIL_ENTRIES; use leleka_cuda_model::draft_check_batch::{self as batch, Check, CheckKind, THREADS}; /// Placeholder asset of a batched check in both command lists (the real module tables are far shorter). diff --git a/crates/cuda-driver/src/mtp_original_full_drafter.rs b/crates/cuda-driver/src/mtp_original_full_drafter.rs index 35188bbd..ab40269d 100644 --- a/crates/cuda-driver/src/mtp_original_full_drafter.rs +++ b/crates/cuda-driver/src/mtp_original_full_drafter.rs @@ -1,7 +1,13 @@ //! Literal host draft loop from core/mtp.cpp778–847. One actual completion per //! predicted step; min_p stops future graph launches, never fabricates drafts. use super::full_round::{DirectVerifierRows, OriginalMtpDraftProgram}; -use super::*; +use super::{ + Context, DraftKvOutcome, DraftKvPolicy, Error, FM, HOST_OFFSETS, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_WINDOW, + MtpInt8OwnerId, MtpInt8Snapshot, MtpOriginalInt8, MtpOriginalRingResources, OriginalDeviceResidual, + OriginalGpuStream, OriginalMtpFullForward, OriginalMtpFullPolicy, OriginalMtpGrVariant, OriginalMtpScalarPrefill, + OriginalMtpStepOutput, PAGE_BYTES, PrefillRows, Rc, RecordRun, Result, SamplerParams, ScalarDraftKvSources, + combine, validate_scalar_prefix, +}; use crate::{ AcceptedWindow, DraftSampling, DraftTarget, NativeHeadSelection, OriginalGpuEvent, OriginalGraphKey, OriginalGraphRegistry, OriginalVerifyWindow, RepeatRowWindow, diff --git a/crates/cuda-driver/src/mtp_original_full_drafter/completed_original_mtp_draft.rs b/crates/cuda-driver/src/mtp_original_full_drafter/completed_original_mtp_draft.rs index cd3e3c46..0943b1f4 100644 --- a/crates/cuda-driver/src/mtp_original_full_drafter/completed_original_mtp_draft.rs +++ b/crates/cuda-driver/src/mtp_original_full_drafter/completed_original_mtp_draft.rs @@ -1,8 +1,7 @@ //! Methods of `CompletedOriginalMtpDraft`: `ids`, `probabilities`, `count`, `final_snapshot` and 4 more. //! Split out of `full_drafter` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{CompletedOriginalMtpDraft, Error, MtpInt8Snapshot, MtpOriginalInt8, Rc, Result}; impl CompletedOriginalMtpDraft<'_> { pub fn ids(&self) -> &[i32] { diff --git a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter.rs b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter.rs index 8cc15c1b..ee82c682 100644 --- a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter.rs +++ b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter.rs @@ -1,8 +1,14 @@ //! Groups the submodules `original_mtp_drafter_chain_gate`, `original_mtp_drafter_finish_chain`, `original_mtp_draft... //! Split out of `full_drafter` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + AcceptedWindow, AdmittedRound, CompletedOriginalMtpDraft, Context, DirectVerifierRows, DraftKvOutcome, + DraftRoundRequest, DraftSampling, DraftTarget, Error, InFlightDraft, MTP_ORIGINAL_MAX_CELLS, MtpInt8Snapshot, + MtpOriginalInt8, NativeHeadSelection, OriginalGpuEvent, OriginalGpuStream, OriginalGraphKey, OriginalGraphRegistry, + OriginalMtpDraftProgram, OriginalMtpDrafter, OriginalMtpFullForward, OriginalMtpFullPolicy, + OriginalMtpScalarPrefill, OriginalMtpStepOutput, OriginalVerifyWindow, PrefillRows, Rc, RecordRun, RepeatRowWindow, + Result, RoundMode, SamplerParams, ScalarDraftKvSources, combine, validate_scalar_prefix, +}; #[path = "original_mtp_drafter/original_mtp_drafter_chain_gate.rs"] mod original_mtp_drafter_chain_gate; diff --git a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_finish_chain.rs b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_finish_chain.rs index ddb31e2a..2f82f982 100644 --- a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_finish_chain.rs +++ b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_finish_chain.rs @@ -1,8 +1,12 @@ //! Methods of `OriginalMtpDrafter`: `finish_inner`, `finish_chain`, `fail_if_poisoned`, `finish_first_step` and 10 m... //! Functions: `chain_key`. Defines `ChainPlan`, `ChainStepAt`, `ChainGraphs`. -#[allow(unused_imports)] -use super::*; +use super::{ + CompletedOriginalMtpDraft, Context, DraftKvOutcome, Error, InFlightDraft, MTP_ORIGINAL_MAX_CELLS, MtpInt8Snapshot, + MtpOriginalInt8, OriginalGpuEvent, OriginalGpuStream, OriginalGraphKey, OriginalGraphRegistry, + OriginalMtpDraftProgram, OriginalMtpDrafter, OriginalMtpFullForward, OriginalMtpFullPolicy, + OriginalMtpScalarPrefill, OriginalMtpStepOutput, PrefillRows, RecordRun, Result, ScalarDraftKvSources, combine, +}; impl<'ctx> OriginalMtpDrafter<'ctx> { /// Read back the first graph of the draft `launch_inner` enqueued, run the chain and close the ring mutation: diff --git a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_keep_bank.rs b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_keep_bank.rs index 7baa7134..dde90006 100644 --- a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_keep_bank.rs +++ b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_keep_bank.rs @@ -1,7 +1,6 @@ //! The drafter's side of a kept verifier bank (`LELEKA_DECODE_GRAPH_REUSE`, docs/experiments/decode-graph-reuse.md). -#[allow(unused_imports)] -use super::*; +use super::{Error, OriginalMtpDrafter, Result}; impl<'ctx> OriginalMtpDrafter<'ctx> { /// End of a request over a verifier bank that STAYS (`LELEKA_DECODE_GRAPH_REUSE`, diff --git a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_launch_rounds.rs b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_launch_rounds.rs index 52699ce2..55f8fbd0 100644 --- a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_launch_rounds.rs +++ b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_launch_rounds.rs @@ -1,8 +1,12 @@ //! Methods of `OriginalMtpDrafter`: `launch_inner`, `launch_prepare`, `launch_record`, `launch_enqueue` and 9 more. //! Split out of `original_mtp_drafter` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + AcceptedWindow, AdmittedRound, Context, DirectVerifierRows, DraftRoundRequest, DraftSampling, DraftTarget, Error, + InFlightDraft, MTP_ORIGINAL_MAX_CELLS, MtpInt8Snapshot, MtpOriginalInt8, NativeHeadSelection, OriginalGpuEvent, + OriginalGpuStream, OriginalGraphKey, OriginalMtpDraftProgram, OriginalMtpDrafter, OriginalMtpFullForward, + OriginalMtpFullPolicy, OriginalMtpScalarPrefill, OriginalVerifyWindow, Rc, Result, RoundMode, SamplerParams, +}; impl<'ctx> OriginalMtpDrafter<'ctx> { /// Admits the request, records the round graph and enqueues it; the draft is finished by `finish_inner`. diff --git a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_new_draft.rs b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_new_draft.rs index d6094e80..184dd67c 100644 --- a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_new_draft.rs +++ b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_new_draft.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMtpDrafter`: `new`, `unregistered`, `validate_context`, `metadata_bytes` and 3 more. //! Split out of `original_mtp_drafter` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + AcceptedWindow, CompletedOriginalMtpDraft, Context, DraftRoundRequest, DraftSampling, DraftTarget, Error, + OriginalGpuStream, OriginalGraphRegistry, OriginalMtpDrafter, OriginalMtpFullForward, OriginalMtpScalarPrefill, + RepeatRowWindow, Result, combine, validate_scalar_prefix, +}; impl<'ctx> OriginalMtpDrafter<'ctx> { pub fn new(full: OriginalMtpFullForward<'ctx>, mut scalar: OriginalMtpScalarPrefill<'ctx>) -> Result { diff --git a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_pipelined_chain.rs b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_pipelined_chain.rs index ec25871b..1fd5c6d5 100644 --- a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_pipelined_chain.rs +++ b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter/original_mtp_drafter_pipelined_chain.rs @@ -2,8 +2,10 @@ //! `original_mtp_drafter_finish_chain.rs` (size). use super::original_mtp_drafter_finish_chain::{ChainGraphs, chain_key}; -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, MtpOriginalInt8, OriginalGpuStream, OriginalGraphKey, OriginalMtpDrafter, OriginalMtpFullPolicy, + OriginalMtpStepOutput, Result, +}; impl<'ctx> OriginalMtpDrafter<'ctx> { /// Chain steps 1..limit enqueued back to back behind the round graph (greedy drafts with `min_p` 0: the depth is diff --git a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter_from_verifier.rs b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter_from_verifier.rs index 3fc5821b..02690c5b 100644 --- a/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter_from_verifier.rs +++ b/crates/cuda-driver/src/mtp_original_full_drafter/original_mtp_drafter_from_verifier.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMtpFullPolicy`: `for_capture`, `capture_key`, `validate_selected`. //! Methods of `OriginalMtpDrafter`: `draft_inner`, `launch_from_verifier`, `finish_from_verifier`, `draft_in_flight`... -#[allow(unused_imports)] -use super::*; +use super::{ + AcceptedWindow, CompletedOriginalMtpDraft, DraftKvPolicy, DraftRoundRequest, DraftSampling, DraftTarget, Error, + MtpInt8Snapshot, MtpOriginalInt8, OriginalGpuEvent, OriginalMtpDrafter, OriginalMtpFullPolicy, + OriginalMtpGrVariant, RepeatRowWindow, Result, +}; impl Drop for OriginalMtpDrafter<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/mtp_original_full_ffi/driver_backed.rs b/crates/cuda-driver/src/mtp_original_full_ffi/driver_backed.rs index a5e6ba36..0054afec 100644 --- a/crates/cuda-driver/src/mtp_original_full_ffi/driver_backed.rs +++ b/crates/cuda-driver/src/mtp_original_full_ffi/driver_backed.rs @@ -3,7 +3,7 @@ //! Built only with the `cuda-driver` feature on 64-bit Linux and Windows; `mtp_original_full_ffi.rs` declares stub //! types for every other build. -use super::*; +use super::{Arg, Arguments, CStr, Copy2D, Error, LaunchShape, Result, c_void, combine}; use crate::mtp_dense_kv::original_int8::abi::LaunchDims; type Load = unsafe extern "C" fn(*mut *mut c_void, *const c_void) -> i32; type Function = unsafe extern "C" fn(*mut *mut c_void, *mut c_void, *const libc::c_char) -> i32; diff --git a/crates/cuda-driver/src/mtp_original_full_forward.rs b/crates/cuda-driver/src/mtp_original_full_forward.rs index 216629a2..b931bff9 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward.rs @@ -1,7 +1,17 @@ //! Literal tail of MtpDrafter::record_forward(full=true), T==1. Private child //! of scalar prefill: only that genuine prefix can create its capture input. //! No public raw span, readiness bit, or host float array authorizes this chain. -use super::*; +use super::{ + Arg, Arguments, BufferHandle, CHUNKS, CStr, Context, DeviceBuffer, DraftKvOutcome, DraftKvPolicy, EmbeddingKind, + Error, HOST_OFFSETS, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_WINDOW, Module, MtpInt8OwnerId, MtpInt8Snapshot, + MtpOriginalInt8, MtpOriginalRingResources, OriginalDeviceResidual, OriginalGpuStream, OriginalGraphResources, + OriginalLayoutSetup, OriginalMtpEmbedding, OriginalMtpGrVariant, OriginalMtpRetainedScalarWeights, + OriginalMtpScalarPolicy, OriginalMtpScalarPrefill, PAGE_BYTES, PrefillRows, ProjectionBuffers, RESERVE_BYTES, Rc, + RecordRun, RefCell, Result, SCALAR_FLAGS, SCRATCH_FLOATS, ScalarCommand, ScalarDraftKvSources, Scratch, abi, + aligned, checked, combine, mapped_records, physical_layout, ring_state, +}; +#[cfg(test)] +use super::TAIL_ENTRIES; #[allow(unsafe_code)] #[path = "mtp_original_full_ffi.rs"] mod full_abi; diff --git a/crates/cuda-driver/src/mtp_original_full_forward/context.rs b/crates/cuda-driver/src/mtp_original_full_forward/context.rs index ea1ffafa..0cd399b1 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/context.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/context.rs @@ -1,8 +1,7 @@ //! Methods of `Context`: `original_mtp_full_forward`. //! Split out of `full_forward` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, OriginalMtpFullForward, OriginalMtpRetainedFullWeights, Rc, Result}; impl<'ctx> Context<'ctx> { pub fn original_mtp_full_forward( diff --git a/crates/cuda-driver/src/mtp_original_full_forward/context_original_mtp_shared_layout.rs b/crates/cuda-driver/src/mtp_original_full_forward/context_original_mtp_shared_layout.rs index 982b96ac..7c451e18 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/context_original_mtp_shared_layout.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/context_original_mtp_shared_layout.rs @@ -1,8 +1,10 @@ //! Methods of `Context`: `original_mtp_shared_layout`, `admit_layout_charge`, `original_mtp_shared_layout_device_byt... //! Functions: `shared_layout_charge`, `layout_setup`, `ring_assets_sealed`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, MtpOriginalInt8, OriginalLayoutSetup, OriginalMtpFullForward, OriginalMtpRetainedFullWeights, + OriginalMtpScalarPrefill, RESERVE_BYTES, Rc, Result, Scratch, combine, physical_layout, ring_state, symbols, +}; /// Whole device charge of the shared Original layout: arena, scalar prefill share, extras and the reserve. fn shared_layout_charge( diff --git a/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program.rs b/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program.rs index 50a1472b..674d951c 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program.rs @@ -1,8 +1,14 @@ //! Groups the submodules `full_forward_program_alias_checks`, `original_mtp_full_forward`. //! Split out of `full_forward` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, BufferHandle, Context, DeviceBuffer, DraftKvPolicy, EmbeddingKind, Error, F, FA, ForwardPrefix, + FullCommand, LaunchShape, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_WINDOW, Module, MtpOriginalInt8, + OriginalMtpEmbedding, OriginalMtpForwardProgram, OriginalMtpFullForward, OriginalMtpFullPolicy, + OriginalMtpNativeGather, OriginalMtpRetainedPrefix, OriginalMtpScalarPolicy, OriginalMtpScalarPrefill, + PrefixEmbedding, PrefixOwners, PrefixRows, ProjectionBuffers, Rc, Result, ScalarAddrs, ScalarCommand, + ScalarPrefixPlan, TAIL_FLAGS, TailArgs, abi, checked, full_abi, validate_scalar_prefix, +}; #[path = "full_forward_prefix_program/full_forward_program_alias_checks.rs"] mod full_forward_program_alias_checks; diff --git a/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/full_forward_program_alias_checks.rs b/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/full_forward_program_alias_checks.rs index 673602a9..5c7f5e27 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/full_forward_program_alias_checks.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/full_forward_program_alias_checks.rs @@ -2,8 +2,12 @@ //! Split out of `full_forward_prefix_program` to keep its files under the line limit. use super::super::mtp_original_check_batch_program::{CheckBatchModules, merge_prefix, merge_tail}; -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, BufferHandle, Context, DeviceBuffer, Error, F, FA, ForwardPrefix, FullCommand, Module, + MtpOriginalInt8, OriginalMtpForwardProgram, OriginalMtpFullForward, OriginalMtpFullPolicy, + OriginalMtpScalarPrefill, PrefixOwners, Rc, Result, ScalarAddrs, ScalarCommand, ScalarPrefixPlan, TAIL_FLAGS, + TailArgs, abi, full_abi, validate_scalar_prefix, +}; impl<'ctx> OriginalMtpFullForward<'ctx> { // Called ONLY at scalar capture preparation, immediately after the genuine diff --git a/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/original_mtp_full_forward.rs b/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/original_mtp_full_forward.rs index a2ec1d68..97e12e07 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/original_mtp_full_forward.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/original_mtp_full_forward.rs @@ -1,8 +1,13 @@ //! Methods of `OriginalMtpFullForward`: `prefix_commands`. //! Split out of `full_forward_prefix_program` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, BufferHandle, DeviceBuffer, DraftKvPolicy, EmbeddingKind, Error, LaunchShape, MTP_ORIGINAL_MAX_CELLS, + MTP_ORIGINAL_WINDOW, MtpOriginalInt8, OriginalMtpEmbedding, OriginalMtpFullForward, OriginalMtpFullPolicy, + OriginalMtpNativeGather, OriginalMtpRetainedPrefix, OriginalMtpScalarPolicy, OriginalMtpScalarPrefill, + PrefixEmbedding, PrefixRows, ProjectionBuffers, Rc, Result, ScalarCommand, ScalarPrefixPlan, checked, + validate_scalar_prefix, +}; mod prefix_parts; mod prefix_rows; diff --git a/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/prefix_parts.rs b/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/prefix_parts.rs index 41b1cccb..ed178d28 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/prefix_parts.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/prefix_parts.rs @@ -1,8 +1,12 @@ //! Phases of `OriginalMtpFullForward::prefix_commands`, split out by STRA-338 (size). Each helper keeps the //! original statement order, so the command list and the error precedence are unchanged. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, BufferHandle, DeviceBuffer, DraftKvPolicy, Error, LaunchShape, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_WINDOW, + MtpOriginalInt8, OriginalMtpEmbedding, OriginalMtpFullForward, OriginalMtpFullPolicy, OriginalMtpNativeGather, + OriginalMtpRetainedPrefix, OriginalMtpScalarPolicy, OriginalMtpScalarPrefill, PrefixEmbedding, ProjectionBuffers, + Rc, Result, ScalarCommand, checked, validate_scalar_prefix, +}; /// Device addresses of the scratch regions and step records that one prefix build touches. pub(super) struct PrefixAddrs { diff --git a/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/prefix_rows.rs b/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/prefix_rows.rs index 1a6c5a76..f021b816 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/prefix_rows.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/full_forward_prefix_program/prefix_rows.rs @@ -1,8 +1,10 @@ //! Embedding lookup, per-row and closing commands of `OriginalMtpFullForward::prefix_commands` (STRA-338 size). use super::prefix_parts::PrefixAddrs; -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, BufferHandle, DraftKvPolicy, EmbeddingKind, Error, LaunchShape, MtpOriginalInt8, OriginalMtpEmbedding, + OriginalMtpFullForward, OriginalMtpScalarPrefill, Result, ScalarCommand, +}; impl<'ctx> OriginalMtpFullForward<'ctx> { /// Embedding row lookup of the `t` token ids into `emb`, for a device-resident embedding table. diff --git a/crates/cuda-driver/src/mtp_original_full_forward/full_owned.rs b/crates/cuda-driver/src/mtp_original_full_forward/full_owned.rs index 583424bc..7ab839ac 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/full_owned.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/full_owned.rs @@ -1,8 +1,10 @@ //! Methods of `FullOwned`: `validate`, `validate_original`, `handle`, `original_handle` and 12 more. //! Implements `Drop for FullOwned`. Functions: `extra_slot`. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, CHUNKS, Context, DeviceBuffer, Error, FM, FullOwned, MtpOriginalInt8, OriginalMtpScalarPrefill, Rc, + Result, aligned, checked, combine, physical_layout, +}; impl FullOwned<'_> { pub(super) fn validate(&self, c: &Context<'_>) -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape.rs b/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape.rs index b1b6a72b..69831664 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape.rs @@ -1,8 +1,11 @@ //! Defines `MatVecBuffers`, `MatVecShape`. //! Split out of `full_forward` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + CHUNKS, DeviceBuffer, DraftKvPolicy, Error, F, ForwardPrefix, FullCommand, LaunchShape, NativeHeadDispatch, + OriginalMtpFullForward, OriginalMtpFullPolicy, OriginalMtpGrVariant, Result, SCRATCH_FLOATS, SamplerParams, + TAIL_FLAGS, daily_mtp, fixed_entry, head_dispatch, mmvf_block, push, symbols, validate_scalar_prefix, +}; /// Device addresses of one matrix-vector product launch: the weight matrix, the input vector and the output vector. #[derive(Clone, Copy)] diff --git a/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_final_gr_stages.rs b/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_final_gr_stages.rs index 45358fb4..bdd5e3b7 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_final_gr_stages.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_final_gr_stages.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalMtpFullForward`: `gr_weight`, `final_gr`, `final_gr_native`, `final_gr_native_tail` and 4 more. //! Split out of `matrix_vector_buffers_and_shape` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, F, ForwardPrefix, FullCommand, LaunchShape, MatVecBuffers, MatVecShape, OriginalMtpFullForward, + OriginalMtpFullPolicy, Result, push, +}; impl OriginalMtpFullForward<'_> { /// Device address of retained weight role `i`. diff --git a/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_finite_tail_mlp_gr.rs b/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_finite_tail_mlp_gr.rs index c71d40d6..e63ab63a 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_finite_tail_mlp_gr.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_finite_tail_mlp_gr.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMtpFullForward`: `finite_tail`, `q8_tail`, `quant`, `mmvq` and 3 more. //! Functions: `second_mlp_entry`. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, F, ForwardPrefix, FullCommand, LaunchShape, MatVecBuffers, MatVecShape, NativeHeadDispatch, + OriginalMtpFullForward, OriginalMtpFullPolicy, OriginalMtpGrVariant, Result, TAIL_FLAGS, fixed_entry, + head_dispatch, mmvf_block, push, +}; impl OriginalMtpFullForward<'_> { pub(in super::super) fn finite_tail(&self, v: &mut Vec, x: u64, n: usize, slot: usize) -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_moe_block_plan.rs b/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_moe_block_plan.rs index 814e7332..62122c9d 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_moe_block_plan.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/full_forward_moe_block_plan.rs @@ -1,8 +1,10 @@ //! The MoE and tail blocks of `OriginalMtpFullForward::plan` (STRA-338), recorded in the order of the former single //! function: router, experts, shared expert and combine; then the final GR, the head and the sampler. -#[allow(unused_imports)] -use super::*; +use super::{ + DeviceBuffer, Error, F, ForwardPrefix, FullCommand, LaunchShape, MatVecBuffers, MatVecShape, + OriginalMtpFullForward, OriginalMtpFullPolicy, Result, SamplerParams, fixed_entry, head_dispatch, push, symbols, +}; /// What the coupled sampler needs besides the logits. struct Coupled { diff --git a/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/original_mtp_full_forward.rs b/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/original_mtp_full_forward.rs index 1bed46b1..76af732b 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/original_mtp_full_forward.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/matrix_vector_buffers_and_shape/original_mtp_full_forward.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMtpFullForward`: `plan`, `validate_plan`, `slot`, `slots` and 11 more. Defines `PlanBufs`. //! `plan` records the commands of one draft step in the order of the former single function; the attention block is ... -#[allow(unused_imports)] -use super::*; +use super::{ + CHUNKS, DraftKvPolicy, Error, F, ForwardPrefix, FullCommand, LaunchShape, MatVecBuffers, MatVecShape, + OriginalMtpFullForward, OriginalMtpFullPolicy, Result, SCRATCH_FLOATS, daily_mtp, fixed_entry, push, symbols, + validate_scalar_prefix, +}; /// The scratch addresses the attention block shares. struct PlanBufs { diff --git a/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_forward_program.rs b/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_forward_program.rs index 4a9a573c..fee41622 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_forward_program.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_forward_program.rs @@ -4,8 +4,11 @@ use super::mtp_original_check_batch_program::{ CheckBatchModules, is_tail_batch, launch_prefix_command, launch_tail_batch, }; -#[allow(unused_imports)] -use super::*; +use super::{ + Error, FA, FullCommand, FullOwned, MtpOriginalRingResources, OriginalCapture, OriginalGraphResources, + OriginalMtpForwardProgram, OriginalMtpNativeGather, OriginalMtpStepOutput, Result, SamplerParams, ScalarCommand, + TAIL_FLAGS, abi, combine, full_abi, symbols, +}; use abi::LaunchShape; impl OriginalMtpForwardProgram<'_> { diff --git a/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_forward_program_original_graph.rs b/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_forward_program_original_graph.rs index 79e057a0..810646c2 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_forward_program_original_graph.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_forward_program_original_graph.rs @@ -1,8 +1,7 @@ //! Implements `Sealed for OriginalMtpForwardProgram`, `OriginalGraphResources for OriginalMtpForwardProgram`. //! Split out of `full_forward` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, Error, OriginalGraphResources, OriginalMtpForwardProgram, Result, checked}; impl crate::original_gpu_schedule::resources::Sealed for OriginalMtpForwardProgram<'_> {} impl OriginalGraphResources for OriginalMtpForwardProgram<'_> { diff --git a/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_full_forward.rs b/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_full_forward.rs index c976bbd5..bfa3cf2c 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_full_forward.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_full_forward.rs @@ -2,8 +2,10 @@ //! Split out of `full_forward` to keep its files under the line limit. use super::mtp_original_full_init::FullGeometry; -#[allow(unused_imports)] -use super::*; +use super::{ + Cell, Context, Error, FM, FullOwned, OriginalMtpFullForward, OriginalMtpRetainedFullWeights, Rc, RefCell, Result, + TailLayout, combine, symbols, +}; impl<'ctx> OriginalMtpFullForward<'ctx> { pub fn planned_device_bytes(vocab: usize, max_t: usize, coupled: bool) -> Result { diff --git a/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_retained_prefix.rs b/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_retained_prefix.rs index afd75e93..31f2dc11 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_retained_prefix.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/original_mtp_retained_prefix.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMtpRetainedPrefix`: `from_scalar`, `native`, `validate_context`, `check_roles` and 1 more. //! Methods of `OriginalMtpRetainedFullWeights`: `retain`, `validate_context`, `metadata_bytes`, `head_rows` and 2 more. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Context, DeviceBuffer, Error, FULL_EXTENTS, FullForwardHead, OriginalMtpNativeEmbedding, + OriginalMtpRetainedFullWeights, OriginalMtpRetainedPrefix, OriginalMtpRetainedScalarWeights, PrefixEmbedding, Rc, + Result, TAIL_FLAGS, TailLayout, aligned, checked, +}; impl<'ctx> OriginalMtpRetainedPrefix<'ctx> { pub fn from_scalar(bank: Rc>) -> Result { diff --git a/crates/cuda-driver/src/mtp_original_full_forward/validate_scalar_prefix.rs b/crates/cuda-driver/src/mtp_original_full_forward/validate_scalar_prefix.rs index 9cb22f1b..523ca586 100644 --- a/crates/cuda-driver/src/mtp_original_full_forward/validate_scalar_prefix.rs +++ b/crates/cuda-driver/src/mtp_original_full_forward/validate_scalar_prefix.rs @@ -1,8 +1,10 @@ //! Functions: `validate_scalar_prefix`, `push`, `daily_mtp`, `chain_mtp_assets` and 2 more. //! Split out of `full_forward` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, F, FA, FullCommand, LaunchShape, OriginalGpuStream, OriginalMtpScalarPrefill, Result, SCALAR_FLAGS, checked, + symbols, +}; // The drafter transfers the EXISTING scalar capture stream into its lifetime // owner. Prefix planning uses the same physical resources without requiring a diff --git a/crates/cuda-driver/src/mtp_original_full_graph.rs b/crates/cuda-driver/src/mtp_original_full_graph.rs index 49f0ee23..dc86d5db 100644 --- a/crates/cuda-driver/src/mtp_original_full_graph.rs +++ b/crates/cuda-driver/src/mtp_original_full_graph.rs @@ -1,5 +1,5 @@ //! Child of original_gpu_schedule. No externally fabricated stream receipt. -use super::*; +use super::{Error, OriginalGpuGraph, OriginalGpuStream, Rc, Result}; use crate::{OriginalMtpForwardProgram, OriginalMtpStepOutput}; impl<'ctx> OriginalGpuGraph<'ctx, OriginalMtpForwardProgram<'ctx>> { pub fn mtp_stage_coupled(&mut self, params: crate::SamplerParams, history: &[i32; 4096]) -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_full_init.rs b/crates/cuda-driver/src/mtp_original_full_init.rs index df1fe94d..f503771a 100644 --- a/crates/cuda-driver/src/mtp_original_full_init.rs +++ b/crates/cuda-driver/src/mtp_original_full_init.rs @@ -1,8 +1,10 @@ //! Construction phases of `OriginalMtpFullForward::new_internal`, split out by STRA-338 (size). Each phase keeps the //! original context-guard, poison and error ordering; `FullOwned::init_device` runs them in the former closure order. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, FM, FullOwned, OriginalMtpRetainedFullWeights, RESERVE_BYTES, Rc, Result, TailLayout, + chain_mtp_assets, combine, daily_mtp, full_mapped, physical_layout, symbols, +}; /// What `new_internal` decides before any device memory exists. pub(super) struct FullGeometry { diff --git a/crates/cuda-driver/src/mtp_original_full_round.rs b/crates/cuda-driver/src/mtp_original_full_round.rs index 1f3d7300..ba6a3a62 100644 --- a/crates/cuda-driver/src/mtp_original_full_round.rs +++ b/crates/cuda-driver/src/mtp_original_full_round.rs @@ -1,7 +1,12 @@ //! Literal MTP round/step capture ordering from core/mtp.cpp629–676. //! The mapped R window is a real owned SessionState-style staging allocation. //! VerifyWindow's device alias is never relabelled as mapped memory. -use super::*; +use super::{ + Context, Error, F, FA, FullCommand, FullOwned, LaunchShape, MTP_ORIGINAL_MAX_CELLS, MtpOriginalInt8, + OriginalCapture, OriginalGraphResources, OriginalMtpForwardProgram, OriginalMtpFullForward, OriginalMtpFullPolicy, + OriginalMtpNativeGather, OriginalMtpScalarPrefill, OriginalMtpStepOutput, PrefixRows, Rc, Result, SamplerParams, + ScalarCommand, ScalarPrefixPlan, combine, full_mapped, push, +}; use crate::{NativeHeadSelection, OriginalVerifyWindow}; pub(super) struct StagedSource<'ctx> { diff --git a/crates/cuda-driver/src/mtp_original_full_round/original_mtp_draft_program.rs b/crates/cuda-driver/src/mtp_original_full_round/original_mtp_draft_program.rs index 6badae25..abe3729d 100644 --- a/crates/cuda-driver/src/mtp_original_full_round/original_mtp_draft_program.rs +++ b/crates/cuda-driver/src/mtp_original_full_round/original_mtp_draft_program.rs @@ -3,7 +3,11 @@ #[allow(unused_imports)] use super::super::mtp_original_check_batch_program::launch_prefix_command; -use super::*; +use super::{ + Error, FA, FullCommand, LaunchShape, MTP_ORIGINAL_MAX_CELLS, NativeHeadSelection, OriginalCapture, + OriginalGraphResources, OriginalMtpDraftProgram, OriginalMtpNativeGather, OriginalMtpStepOutput, + OriginalVerifyWindow, Rc, Result, SamplerParams, ScalarCommand, StagedSource, combine, full_mapped, overlap, put, +}; impl<'ctx> OriginalMtpDraftProgram<'ctx> { pub(super) fn enqueue_commands(&mut self, c: &mut OriginalCapture<'_, '_>, which: bool) -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_full_round/post_select.rs b/crates/cuda-driver/src/mtp_original_full_round/post_select.rs index ea048e21..aadb7817 100644 --- a/crates/cuda-driver/src/mtp_original_full_round/post_select.rs +++ b/crates/cuda-driver/src/mtp_original_full_round/post_select.rs @@ -1,8 +1,10 @@ //! Functions: `post_select`. //! Split out of `full_round` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, FullCommand, OriginalMtpForwardProgram, Result, SelectionReadback, SelectionSource, SelectionTarget, + mtp_select, +}; pub(super) fn post_select(p: &OriginalMtpForwardProgram<'_>, j: usize) -> Result> { let mut v = Vec::new(); diff --git a/crates/cuda-driver/src/mtp_original_full_round/put.rs b/crates/cuda-driver/src/mtp_original_full_round/put.rs index bb13862d..293ca488 100644 --- a/crates/cuda-driver/src/mtp_original_full_round/put.rs +++ b/crates/cuda-driver/src/mtp_original_full_round/put.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMtpFullForward`: `stage_first_residual`, `check_staging_window`, `check_first_repeat`, `insta... //! Methods of `OriginalMtpDraftProgram`: `uses_direct_verifier_window`. -#[allow(unused_imports)] -use super::*; +use super::{ + DirectVerifierRows, Error, F, LaunchShape, MTP_ORIGINAL_MAX_CELLS, MtpOriginalInt8, NativeHeadSelection, + OriginalMtpDraftProgram, OriginalMtpFullForward, OriginalMtpFullPolicy, OriginalMtpScalarPrefill, + OriginalVerifyWindow, RESIDUAL_ROW_BYTES, Rc, Result, StagedSource, combine, full_mapped, push, +}; pub(super) fn put(m: &mut full_mapped::MappedOwner, max_t: usize, row: usize, cell: usize) -> Result<()> { if row >= 2 * max_t || cell >= 262144 { diff --git a/crates/cuda-driver/src/mtp_original_full_round/staged_source.rs b/crates/cuda-driver/src/mtp_original_full_round/staged_source.rs index 25aa87ca..ad7abda5 100644 --- a/crates/cuda-driver/src/mtp_original_full_round/staged_source.rs +++ b/crates/cuda-driver/src/mtp_original_full_round/staged_source.rs @@ -2,8 +2,12 @@ //! Methods of `FullOwned`: `mapped_window_offset`, `validate_staged`, `validate_staged_ahead`. use super::super::mtp_original_check_batch_program::merge_prefix; -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, F, FullCommand, FullOwned, LaunchShape, MtpOriginalInt8, OriginalGraphResources, + OriginalMtpDraftProgram, OriginalMtpForwardProgram, OriginalMtpFullForward, OriginalMtpFullPolicy, + OriginalMtpScalarPrefill, PrefixRows, Result, ScalarCommand, ScalarPrefixPlan, SelectionReadback, SelectionSource, + SelectionTarget, StagedSource, post_select, push, +}; impl StagedSource<'_> { pub(super) fn validate(&self, c: &Context<'_>) -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_full_symbols.rs b/crates/cuda-driver/src/mtp_original_full_symbols.rs index fc3453db..365339e6 100644 --- a/crates/cuda-driver/src/mtp_original_full_symbols.rs +++ b/crates/cuda-driver/src/mtp_original_full_symbols.rs @@ -1,4 +1,4 @@ -use super::*; +use super::CStr; #[path = "mtp_original_full_symbols/assets_types.rs"] mod assets_types; diff --git a/crates/cuda-driver/src/mtp_original_full_symbols/assets_types.rs b/crates/cuda-driver/src/mtp_original_full_symbols/assets_types.rs index c9943efd..7171ae6a 100644 --- a/crates/cuda-driver/src/mtp_original_full_symbols/assets_types.rs +++ b/crates/cuda-driver/src/mtp_original_full_symbols/assets_types.rs @@ -1,8 +1,7 @@ //! Items of the parent module. //! Split out of `symbols` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::CStr; pub(in super::super) const ASSETS: &[(&[u8], &[&CStr])] = &[ ( diff --git a/crates/cuda-driver/src/mtp_original_full_symbols/chain_asset_types.rs b/crates/cuda-driver/src/mtp_original_full_symbols/chain_asset_types.rs index 98b82379..9c9d9896 100644 --- a/crates/cuda-driver/src/mtp_original_full_symbols/chain_asset_types.rs +++ b/crates/cuda-driver/src/mtp_original_full_symbols/chain_asset_types.rs @@ -1,9 +1,6 @@ //! Items of the parent module. //! CHAIN_ASSET, DAILY_ASSET, DAILY_CHUNK, DAILY_MERGE_V2, CHAIN_QSA_CHUNK, CHAIN_QSA_MERGE_N .... -#[allow(unused_imports)] -use super::*; - /// Index of the chain module in `ASSETS` (absent from the loaded modules unless `LELEKA_CHAIN` selects `mtp` or /// `head`). pub(in super::super) const CHAIN_ASSET: usize = 21; diff --git a/crates/cuda-driver/src/mtp_original_int8/mtp_int8_owner_id.rs b/crates/cuda-driver/src/mtp_original_int8/mtp_int8_owner_id.rs index 610e88d8..28becec9 100644 --- a/crates/cuda-driver/src/mtp_original_int8/mtp_int8_owner_id.rs +++ b/crates/cuda-driver/src/mtp_original_int8/mtp_int8_owner_id.rs @@ -1,8 +1,11 @@ //! Methods of `MtpInt8OwnerId`: `same_owner`. Methods of `Pages`: `empty`, `from_vec`, `with_tail`, `len` and 2 more. //! Implements `Clone for MtpOriginalRingResources`. Functions: `snapshot_memo`. -#[allow(unused_imports)] -use super::*; +use super::{ + CompletedMtpAttention, CompletedMtpKvReplay, Context, DeviceBuffer, Error, MtpInt8OwnerId, MtpInt8Snapshot, + MtpOriginalMixed, MtpOriginalQuery, MtpOriginalRingResources, Origin, PAGES_PER_CHUNK, Page, Pages, PhysicalRing, + Rc, Result, Snapshot, checked, rows_range, +}; impl MtpInt8OwnerId { pub fn same_owner(&self, other: &Self) -> bool { diff --git a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations.rs b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations.rs index bcd8cde5..02b38a31 100644 --- a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations.rs +++ b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations.rs @@ -2,8 +2,14 @@ //! restore, ring bring-up, validate and execute. //! One impl split over these files so that each stays under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + ATTN_ENTRIES, Arg, Arguments, CHUNKS, Cell, Command, CompletedMtpAttention, CompletedMtpKvReplay, Context, + DeviceBuffer, Error, HOST_OFFSETS, KV_ENTRIES, LaunchDims, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_PINNED_HOST_BYTES, + MTP_ORIGINAL_SNAPSHOT_PAYLOAD_BYTES, MTP_ORIGINAL_WINDOW, MappedOwner, Module, MtpInt8Snapshot, MtpOriginalInt8, + MtpOriginalMixed, MtpOriginalQuery, MtpOriginalRingResources, NativeBatchWorkspace, Origin, PAGE_BYTES, Page, + Pages, PhysicalRing, RESERVE, Rc, Ref, RefCell, RefMut, Result, SCRATCH_FLOATS, STATUS_WORDS, Snapshot, + TAIL_ENTRIES, abi, checked, combine, layout, rows_range, snapshot_memo, zero_bytes, +}; #[path = "mtp_original_int8_operations/mtp_original_int8_attend_split_k.rs"] mod mtp_original_int8_attend_split_k; diff --git a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_attend_split_k.rs b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_attend_split_k.rs index 842eff6b..f70e3e2a 100644 --- a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_attend_split_k.rs +++ b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_attend_split_k.rs @@ -1,8 +1,10 @@ //! Methods of `MtpOriginalInt8`: `attend`, `check_attend`, `admit_query`, `addresses` and 6 more. //! Split out of `mtp_original_int8_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, CHUNKS, Command, CompletedMtpAttention, Error, LaunchDims, MTP_ORIGINAL_WINDOW, MtpInt8Snapshot, + MtpOriginalInt8, MtpOriginalQuery, NativeBatchWorkspace, Rc, Result, SCRATCH_FLOATS, STATUS_WORDS, +}; impl<'ctx> MtpOriginalInt8<'ctx> { /// Literal Original dense-window INT8 split-K attention. No selected index, diff --git a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_kv_only_replay.rs b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_kv_only_replay.rs index eb1c7a15..7babde8b 100644 --- a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_kv_only_replay.rs +++ b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_kv_only_replay.rs @@ -1,8 +1,11 @@ //! Methods of `MtpOriginalInt8`: `record_kv_only`, `kv_only_admit`, `kv_only_stage`, `kv_only_run` and 13 more. //! Split out of `mtp_original_int8_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Command, CompletedMtpKvReplay, DeviceBuffer, Error, LaunchDims, MtpInt8Snapshot, MtpOriginalInt8, + MtpOriginalMixed, NativeBatchWorkspace, PAGE_BYTES, Page, Pages, Rc, Result, STATUS_WORDS, Snapshot, rows_range, + zero_bytes, +}; impl<'ctx> MtpOriginalInt8<'ctx> { /// Exact attention tail of record_forward(false). Real input+GR has already diff --git a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_restore.rs b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_restore.rs index 4337d604..8e5242a3 100644 --- a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_restore.rs +++ b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_restore.rs @@ -1,8 +1,9 @@ //! Methods of `MtpOriginalInt8`: `restore`, `begin_restore`, `restore_resident`, `write_host_pages` and 1 more. //! Functions: `page_shared`. -#[allow(unused_imports)] -use super::*; +use super::{ + Command, Error, HOST_OFFSETS, MtpInt8Snapshot, MtpOriginalInt8, NativeBatchWorkspace, PAGE_BYTES, Page, Rc, Result, +}; /// Whether the previous witness already holds this very page at index `p`. fn page_shared(previous: Option<&MtpInt8Snapshot>, p: usize, page: &Rc) -> bool { diff --git a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_ring_bring_up.rs b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_ring_bring_up.rs index 2b2b2037..f1c76369 100644 --- a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_ring_bring_up.rs +++ b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_ring_bring_up.rs @@ -1,8 +1,12 @@ //! Methods of `MtpOriginalInt8`: `planned_device_bytes`, `pinned_host_bytes`, `max_snapshot_payload_bytes`, `max_sna... //! Functions: `kv_assets_sealed`. -#[allow(unused_imports)] -use super::*; +use super::{ + ATTN_ENTRIES, Cell, Context, DeviceBuffer, Error, KV_ENTRIES, MTP_ORIGINAL_PINNED_HOST_BYTES, + MTP_ORIGINAL_SNAPSHOT_PAYLOAD_BYTES, MappedOwner, Module, MtpOriginalInt8, MtpOriginalRingResources, Origin, Page, + PhysicalRing, RESERVE, Rc, Ref, RefCell, RefMut, Result, Snapshot, TAIL_ENTRIES, checked, combine, layout, + zero_bytes, +}; /// The ring's tail and KV PTX images must be sealed (no placeholder artifact). fn kv_assets_sealed() -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_validate_execute.rs b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_validate_execute.rs index ac87ce9d..36e9571f 100644 --- a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_validate_execute.rs +++ b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_operations/mtp_original_int8_validate_execute.rs @@ -1,8 +1,11 @@ //! Methods of `MtpOriginalInt8`: `validate`, `provided`, `validate_pool`, `reject_earlier_overlap` and 12 more. //! Split out of `mtp_original_int8_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, Command, DeviceBuffer, Error, LaunchDims, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_PINNED_HOST_BYTES, + Module, MtpInt8Snapshot, MtpOriginalInt8, NativeBatchWorkspace, PAGE_BYTES, Pages, Rc, Result, STATUS_WORDS, + Snapshot, abi, checked, combine, snapshot_memo, +}; use abi::LaunchShape; impl<'ctx> MtpOriginalInt8<'ctx> { diff --git a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_state_adoption.rs b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_state_adoption.rs index a89f8800..e2deffab 100644 --- a/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_state_adoption.rs +++ b/crates/cuda-driver/src/mtp_original_int8/mtp_original_int8_state_adoption.rs @@ -1,8 +1,10 @@ //! Methods of `MtpOriginalInt8`: `new_original_state`, `bring_up_state`, `load_state_modules`, `adopt_selected` and ... //! Implements `Drop for MtpOriginalInt8`. Functions: `original_state_sealed`. -#[allow(unused_imports)] -use super::*; +use super::{ + ATTN_ENTRIES, Context, DeviceBuffer, Error, HOST_OFFSETS, HOST_RUNS, KV_ENTRIES, MappedOwner, Module, + MtpOriginalInt8, PAGE_BYTES, RESERVE, Rc, Result, TAIL_ENTRIES, combine, layout, ring_state, +}; impl Drop for MtpOriginalInt8<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/mtp_original_int8/physical_ring.rs b/crates/cuda-driver/src/mtp_original_int8/physical_ring.rs index 23ddf96c..573a484a 100644 --- a/crates/cuda-driver/src/mtp_original_int8/physical_ring.rs +++ b/crates/cuda-driver/src/mtp_original_int8/physical_ring.rs @@ -1,8 +1,10 @@ //! Methods of `PhysicalRing`: `validate_context`, `unavailable`, `close_inner`, `close_modules` and 1 more. //! Methods of `Context`: `mtp_original_int8`. Implements `Drop for PhysicalRing`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_WINDOW, MtpOriginalInt8, PhysicalRing, Result, + SCRATCH_FLOATS, STATUS_WORDS, combine, +}; impl PhysicalRing<'_> { pub(super) fn validate_context(&self, c: &Context<'_>) -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_int8_ffi/arguments.rs b/crates/cuda-driver/src/mtp_original_int8_ffi/arguments.rs index 5e90c43d..38b68978 100644 --- a/crates/cuda-driver/src/mtp_original_int8_ffi/arguments.rs +++ b/crates/cuda-driver/src/mtp_original_int8_ffi/arguments.rs @@ -1,8 +1,7 @@ //! Methods of `Arguments`: `metadata_bytes`, `new`. Methods of `Module`: `load`, `launch`, `copy`, `close`. //! Split out of `abi` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Arg, Arguments, Error, Result, c_void}; impl Arguments { pub(crate) fn metadata_bytes(&self) -> usize { diff --git a/crates/cuda-driver/src/mtp_original_int8_ffi/driver_backed.rs b/crates/cuda-driver/src/mtp_original_int8_ffi/driver_backed.rs index 6dffa383..2415e4bb 100644 --- a/crates/cuda-driver/src/mtp_original_int8_ffi/driver_backed.rs +++ b/crates/cuda-driver/src/mtp_original_int8_ffi/driver_backed.rs @@ -2,7 +2,7 @@ //! Built only with the `cuda-driver` feature on 64-bit Linux and Windows; `mtp_original_int8_ffi.rs` declares stub //! types for every other build. -use super::*; +use super::{Arg, Arguments, CStr, Error, LaunchDims, LaunchShape, Result, c_void, combine}; type Load = unsafe extern "C" fn(*mut *mut c_void, *const c_void) -> i32; type Function = unsafe extern "C" fn(*mut *mut c_void, *mut c_void, *const libc::c_char) -> i32; type Unload = unsafe extern "C" fn(*mut c_void) -> i32; diff --git a/crates/cuda-driver/src/mtp_original_int8_ffi/host_enabled.rs b/crates/cuda-driver/src/mtp_original_int8_ffi/host_enabled.rs index 177f2507..3c30b37d 100644 --- a/crates/cuda-driver/src/mtp_original_int8_ffi/host_enabled.rs +++ b/crates/cuda-driver/src/mtp_original_int8_ffi/host_enabled.rs @@ -1,7 +1,7 @@ //! Methods of `MappedOwner`: `new`, `new_sized`, `new_for_state`, `new_inner` and 9 more. //! Implements `Drop for Library`, `Drop for MappedOwner`. Functions: `check`, `host_alloc`. -use super::*; +use super::{Error, HOST_BYTES, Result}; use std::ffi::c_void; type Alloc = unsafe extern "C" fn(*mut *mut c_void, usize, u32) -> i32; type Address = unsafe extern "C" fn(*mut u64, *mut c_void, u32) -> i32; diff --git a/crates/cuda-driver/src/mtp_original_logical_prefix.rs b/crates/cuda-driver/src/mtp_original_logical_prefix.rs index e03548c0..45f04d92 100644 --- a/crates/cuda-driver/src/mtp_original_logical_prefix.rs +++ b/crates/cuda-driver/src/mtp_original_logical_prefix.rs @@ -1,6 +1,9 @@ //! Child of mtp_original_int8. A skipped Original prompt group advances only //! the logical conditioning cursor; it NEVER manufactures materialized KV pages. -use super::*; +use super::{ + Error, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_WINDOW, MtpInt8Snapshot, MtpOriginalInt8, PAGE_BYTES, Page, Rc, Result, + Snapshot, zero_bytes, +}; use crate::{OriginalDeviceResidual, OriginalPromptLeaseIdentity}; /// Genuine ring- and prompt-lease-bound no-work result. The retained physical /// snapshot remains unchanged and may be empty even when `logical_end` is large. diff --git a/crates/cuda-driver/src/mtp_original_native_embedding.rs b/crates/cuda-driver/src/mtp_original_native_embedding.rs index 8d44f250..f5d79c5c 100644 --- a/crates/cuda-driver/src/mtp_original_native_embedding.rs +++ b/crates/cuda-driver/src/mtp_original_native_embedding.rs @@ -1,5 +1,7 @@ //! PRIVATE child of native_head. Genuine native mapped/VRAM embedding owner. -use super::*; +use super::{ + Arg, Command, Context, EmbedOwned, Error, OriginalCapture, OriginalNativeEmbed, Rc, Result, cmd, transport, +}; #[derive(Clone)] pub struct OriginalMtpNativeEmbedding<'ctx> { owner: Rc>, diff --git a/crates/cuda-driver/src/mtp_original_prefill.rs b/crates/cuda-driver/src/mtp_original_prefill.rs index 11735775..cd01fd50 100644 --- a/crates/cuda-driver/src/mtp_original_prefill.rs +++ b/crates/cuda-driver/src/mtp_original_prefill.rs @@ -1,7 +1,12 @@ //! Literal prefill.cpp741..886, Q8_0 branch, on the actual borrowed prompt //! region. Register as a PRIVATE child of mtp_original_int8: ring/host backing //! never becomes a public address or a fabricated owning DeviceBuffer. -use super::*; +use super::{ + CHUNKS, Context, DeviceBuffer, Error, HOST_OFFSETS, HOST_RUNS, KV_ENTRIES, MTP_ORIGINAL_MAX_CELLS, + MTP_ORIGINAL_PINNED_HOST_BYTES, MTP_ORIGINAL_WINDOW, MtpInt8OwnerId, MtpInt8Snapshot, MtpOriginalInt8, + MtpOriginalRingResources, NativeBatchWorkspace, PAGE_BYTES, Page, Pages, Rc, Result, SCRATCH_FLOATS, Snapshot, + TAIL_ENTRIES, abi, checked, combine, ring_state, zero_bytes, +}; use crate::ffi::BufferHandle; use crate::original_prefill_arena::OriginalPromptSpan; use crate::{OriginalDeviceResidual, OriginalPromptRows}; diff --git a/crates/cuda-driver/src/mtp_original_prefill/completed_draft_kv.rs b/crates/cuda-driver/src/mtp_original_prefill/completed_draft_kv.rs index 5e1d9197..445c70ac 100644 --- a/crates/cuda-driver/src/mtp_original_prefill/completed_draft_kv.rs +++ b/crates/cuda-driver/src/mtp_original_prefill/completed_draft_kv.rs @@ -1,8 +1,10 @@ //! Methods of `CompletedDraftKv`: `validate_current`, `first_materialized`, `next_position`, `owner_id` and 3 more. //! Methods of `OriginalMtpEmbedding`: `native`, `compressed`, `vocab`. -#[allow(unused_imports)] -use super::*; +use super::{ + CompletedDraftKv, CompressedEmbedding, DeviceBuffer, DraftKvPolicy, EmbeddingKind, Error, MtpInt8OwnerId, + MtpInt8Snapshot, MtpOriginalInt8, OriginalMtpEmbedding, Rc, Result, Snapshot, +}; impl CompletedDraftKv { pub fn validate_current(&self, ring: &MtpOriginalInt8<'_>) -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill.rs b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill.rs index 5cb55ab0..ac1b2c41 100644 --- a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill.rs +++ b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill.rs @@ -1,8 +1,14 @@ //! Groups the submodules `block_commands`, `kernel_commands`, `original_mtp_prefill_close` and 4 more. //! Split out of `prefill` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, Args, BufferHandle, Cmd, CompletedDraftKv, Context, DeviceBuffer, DraftKvFallback, DraftKvOutcome, + DraftKvPolicy, DraftKvSources, ENTRIES, EmbeddingKind, Error, FLAG_WORDS, HOST_OFFSETS, HOST_RUNS, + MTP_ORIGINAL_MAX_CELLS, Mod, MtpInt8Snapshot, MtpOriginalInt8, NativeBatchWorkspace, OriginalDeviceResidual, + OriginalMtpEmbedding, OriginalMtpPrefill, OriginalMtpPrefillWeights, OriginalPromptRows, OriginalPromptSpan, + PAGE_BYTES, Page, Pages, PrefillGeometry, PrefillRows, RESERVE_BYTES, Rc, RecordRun, Region, Result, Snapshot, + WIDTHS, combine, fastdiv, q8_bytes, symbols, zero_bytes, +}; #[path = "original_mtp_prefill/block_commands.rs"] mod block_commands; diff --git a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/block_commands.rs b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/block_commands.rs index 65a37a3f..b7b04729 100644 --- a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/block_commands.rs +++ b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/block_commands.rs @@ -1,8 +1,11 @@ //! Commands of one block of `OriginalMtpPrefill::record` (STRA-338): the embedding, hidden, GR and K/V phases are //! recorded in the order of the former single function, then run; the append kernels follow in `append_block`. -#[allow(unused_imports)] -use super::*; +use super::{ + A, AppendBlock, Block, BufferHandle, Call, Cmd, DraftKvPolicy, EmbeddingKind, Error, GrBufs, HOST_OFFSETS, + HOST_RUNS, KernelAt, KernelShape, MtpOriginalInt8, NativeBatchWorkspace, OriginalMtpEmbedding, OriginalMtpPrefill, + OriginalPromptRows, ProjectionAddresses, ProjectionDims, Result, zero_bytes, +}; impl<'ctx> OriginalMtpPrefill<'ctx> { /// `Self::kernel` for this program: no dynamic shared memory and `block` threads in x. diff --git a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/kernel_commands.rs b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/kernel_commands.rs index 14643419..ab9e16ef 100644 --- a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/kernel_commands.rs +++ b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/kernel_commands.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMtpPrefill`: `new`, `sealed_assets`, `open`, `load_modules` and 10 more. //! Split out of `original_mtp_prefill` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, Args, BufferHandle, Cmd, Context, DeviceBuffer, ENTRIES, Error, FLAG_WORDS, KernelAt, KernelShape, Mod, + NativeBatchWorkspace, OriginalMtpPrefill, OriginalPromptRows, OriginalPromptSpan, RESERVE_BYTES, Result, combine, + symbols, +}; impl<'ctx> OriginalMtpPrefill<'ctx> { pub(in super::super) fn new(context: &'ctx Context<'ctx>) -> Result { diff --git a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/original_mtp_prefill_close.rs b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/original_mtp_prefill_close.rs index d6eb5c07..0c5ad030 100644 --- a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/original_mtp_prefill_close.rs +++ b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/original_mtp_prefill_close.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalMtpPrefill`: `close`, `close_inner`, `close_module`, `release_buffer`. //! Split out of `original_mtp_prefill` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, Error, Mod, OriginalMtpPrefill, Result, combine}; impl<'ctx> OriginalMtpPrefill<'ctx> { pub fn close(mut self) -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/projection_commands.rs b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/projection_commands.rs index 50769e4b..8ef557dd 100644 --- a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/projection_commands.rs +++ b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/projection_commands.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalMtpPrefill`: `project`, `project_launch`, `project_tile`, `project_grid` and 6 more. //! Split out of `original_mtp_prefill` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, Cmd, Error, KernelAt, KernelShape, OriginalMtpPrefill, ProjectionAddresses, ProjectionDims, Region, Result, + WIDTHS, fastdiv, q8_bytes, +}; impl<'ctx> OriginalMtpPrefill<'ctx> { pub(in super::super) fn project( diff --git a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/record_operands.rs b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/record_operands.rs index 5ea36d3e..fc4fe01a 100644 --- a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/record_operands.rs +++ b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/record_operands.rs @@ -1,7 +1,9 @@ //! Operands of `OriginalMtpPrefill::record` (STRA-338): the call, the admission and staging results, and the block. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, DraftKvOutcome, DraftKvPolicy, Error, MtpInt8Snapshot, MtpOriginalInt8, OriginalMtpEmbedding, + OriginalMtpPrefillWeights, Region, Result, +}; /// Host copies of the four runs of one 4-cell page. pub(in super::super) type PageRuns = [Vec; 4]; diff --git a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/record_walk.rs b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/record_walk.rs index 902e1585..eb941c7d 100644 --- a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/record_walk.rs +++ b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/record_walk.rs @@ -1,8 +1,13 @@ //! Methods of `OriginalMtpPrefill`: `record`, `record_call`, `admit`, `fallback_for` and 16 more. //! Functions: `weight_refs`. -#[allow(unused_imports)] -use super::*; +use super::{ + Admit, AppendBlock, Block, BufferHandle, Call, CompletedDraftKv, DeviceBuffer, DraftKvFallback, DraftKvOutcome, + DraftKvPolicy, DraftKvSources, Error, HOST_OFFSETS, MTP_ORIGINAL_MAX_CELLS, MtpInt8Snapshot, MtpOriginalInt8, + NativeBatchWorkspace, OriginalDeviceResidual, OriginalMtpPrefill, OriginalMtpPrefillWeights, OriginalPromptRows, + OriginalPromptSpan, PAGE_BYTES, Page, PageRuns, Pages, PrefillRows, Rc, RecordRun, Region, Result, Snapshot, Stage, + Staged, WEIGHT_EXTENTS, WIDTHS, zero_bytes, +}; /// The weights in the order of `WEIGHT_EXTENTS`. fn weight_refs<'a, 'c>(w: &OriginalMtpPrefillWeights<'a, 'c>) -> [&'a DeviceBuffer<'c>; 10] { diff --git a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/run_and_settle.rs b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/run_and_settle.rs index 7a345a08..006662cb 100644 --- a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/run_and_settle.rs +++ b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill/run_and_settle.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalMtpPrefill`: `run`, `checked_status`, `mark_run_failed`, `run_error` and 4 more. //! Methods of `RunJob`: `new`. Functions: `status_word`. Defines `StatusRead`, `RunJob`, `Settled`. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Cmd, Error, FLAG_WORDS, NativeBatchWorkspace, OriginalMtpPrefill, OriginalPromptRows, + PrefillGeometry, Result, combine, zero_bytes, +}; use crate::CurrentGuard; use crate::ple_batch_ffi::Blas; use crate::ple_batch_ffi::{GemmDims, GemmOperands, GemmScalars}; diff --git a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill_drop.rs b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill_drop.rs index 37364615..c68af9d7 100644 --- a/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill_drop.rs +++ b/crates/cuda-driver/src/mtp_original_prefill/original_mtp_prefill_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for OriginalMtpPrefill`. //! Split out of `prefill` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::OriginalMtpPrefill; impl Drop for OriginalMtpPrefill<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/mtp_original_prefill/region.rs b/crates/cuda-driver/src/mtp_original_prefill/region.rs index 296e875b..6d43ef26 100644 --- a/crates/cuda-driver/src/mtp_original_prefill/region.rs +++ b/crates/cuda-driver/src/mtp_original_prefill/region.rs @@ -1,8 +1,7 @@ //! Methods of `Region`: `new`, `per_row`, `widths`, `handle` and 1 more. Methods of `Context`: `original_mtp_prefill`. //! Split out of `prefill` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{BufferHandle, Context, Error, OriginalMtpPrefill, Region, Result, aligned, q8_bytes}; impl Region { pub(super) fn new(base: BufferHandle, bytes: usize, n: usize, r0: usize) -> Result> { diff --git a/crates/cuda-driver/src/mtp_original_ring_state.rs b/crates/cuda-driver/src/mtp_original_ring_state.rs index 834e3178..a079a4c4 100644 --- a/crates/cuda-driver/src/mtp_original_ring_state.rs +++ b/crates/cuda-driver/src/mtp_original_ring_state.rs @@ -1,6 +1,9 @@ //! Private Original qsa_state Cursor16 carve + selected MTP main-bank loans. //! Addresses derive from whole owned banks; no DeviceBuffer-shaped fake views. -use super::*; +use super::{ + Cell, Context, DeviceBuffer, Error, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_PINNED_HOST_BYTES, MTP_ORIGINAL_WINDOW, + MappedOwner, PAGE_BYTES, RESERVE, Rc, Result, checked, combine, zero_bytes, +}; use crate::ffi::BufferHandle; #[derive(Clone)] pub(super) struct StateLayout { diff --git a/crates/cuda-driver/src/mtp_original_ring_state/a16.rs b/crates/cuda-driver/src/mtp_original_ring_state/a16.rs index dfeb4935..59395bad 100644 --- a/crates/cuda-driver/src/mtp_original_ring_state/a16.rs +++ b/crates/cuda-driver/src/mtp_original_ring_state/a16.rs @@ -1,8 +1,7 @@ //! Methods of `StateLayout`: `new`, `region_sizes`. Functions: `a16`. //! Split out of `ring_state` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Error, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_WINDOW, Result, StateLayout}; pub(super) fn a16(n: usize) -> Result { n.checked_add(15).map(|n| n & !15).ok_or(Error::InvalidSize) diff --git a/crates/cuda-driver/src/mtp_original_ring_state/cleanup_fns.rs b/crates/cuda-driver/src/mtp_original_ring_state/cleanup_fns.rs index 8cb91460..983bda25 100644 --- a/crates/cuda-driver/src/mtp_original_ring_state/cleanup_fns.rs +++ b/crates/cuda-driver/src/mtp_original_ring_state/cleanup_fns.rs @@ -1,7 +1,7 @@ //! Cleanup shared by the ring-state owners: close a mapped owner, release a device buffer. //! A poisoned context forgets the owner instead of touching the driver; any failure poisons the context. -use super::*; +use super::{Context, DeviceBuffer, Error, MappedOwner, Result, combine}; pub(super) fn close_mapped(c: &Context<'_>, mut m: MappedOwner) -> Result<()> { let r = if c.is_poisoned() { diff --git a/crates/cuda-driver/src/mtp_original_ring_state/pin_failure.rs b/crates/cuda-driver/src/mtp_original_ring_state/pin_failure.rs index aec2e240..1e2580f7 100644 --- a/crates/cuda-driver/src/mtp_original_ring_state/pin_failure.rs +++ b/crates/cuda-driver/src/mtp_original_ring_state/pin_failure.rs @@ -2,8 +2,10 @@ //! Implements `Drop for PreparedState`. Functions: `pin_failure`, `enter_poisoning`. use super::cleanup_fns::{close_mapped, release_state}; -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, MTP_ORIGINAL_PINNED_HOST_BYTES, MappedOwner, PreparedState, RESERVE, Result, + StateLayout, combine, zero_bytes, +}; use crate::CurrentGuard; /// Only actual CUDA pinned allocation/mapping failures choose Original fallback. diff --git a/crates/cuda-driver/src/mtp_original_ring_state/selected.rs b/crates/cuda-driver/src/mtp_original_ring_state/selected.rs index 07953fc7..0b9ab227 100644 --- a/crates/cuda-driver/src/mtp_original_ring_state/selected.rs +++ b/crates/cuda-driver/src/mtp_original_ring_state/selected.rs @@ -2,8 +2,10 @@ //! Functions: `main_span_index`. use super::cleanup_fns::{close_mapped, release_state}; -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Cell, Context, DeviceBuffer, Error, MappedOwner, PAGE_BYTES, PreparedState, Rc, Result, Selected, + checked, combine, zero_bytes, +}; impl<'ctx> Selected<'ctx> { pub(in super::super) fn from_prepared( diff --git a/crates/cuda-driver/src/mtp_original_scalar_graph.rs b/crates/cuda-driver/src/mtp_original_scalar_graph.rs index a24c1944..31c98ce1 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_graph.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_graph.rs @@ -1,6 +1,10 @@ //! Literal cached MtpDrafter prefill graph scheduling. All kernel ABI arguments //! and real physical input/scratch/weight owners survive capture and replay. -use super::*; +use super::{ + BufferHandle, Error, GraphResources, Module, MtpOriginalInt8, NativeBatchWorkspace, OriginalGraphKey, + OriginalMtpRetainedScalarWeights, OriginalMtpScalarPrefill, OriginalPromptRows, Rc, Result, SCALAR_FLAGS, + ScalarCommand, combine, zero_bytes, +}; /// One group of prompt rows handed to the stream: its rows and cells, and the kernel and copy commands that run for it. pub(super) struct GroupSubmission<'a> { diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill.rs index 4957f0e7..d49b6210 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill.rs @@ -1,7 +1,14 @@ //! Literal MtpDrafter::record_forward(full=false), groups <= actual max_t. //! Private child of Original prefill. K/V, Q8 scratch and mapped host are the //! actual MtpOriginalInt8 owner; no half-cache or batch-GEMM substitution. -use super::*; +use super::{ + BufferHandle, CHUNKS, CStr, Context, DeviceBuffer, DraftKvOutcome, DraftKvPolicy, ENTRIES, EmbeddingKind, Error, + HOST_OFFSETS, KV_ENTRIES, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_PINNED_HOST_BYTES, MTP_ORIGINAL_WINDOW, + MtpInt8OwnerId, MtpInt8Snapshot, MtpOriginalInt8, MtpOriginalRingResources, NativeBatchWorkspace, + OriginalDeviceResidual, OriginalMtpEmbedding, OriginalMtpPrefill, OriginalMtpPrefillWeights, OriginalPromptRows, + OriginalPromptSpan, PAGE_BYTES, Page, PrefillRows, RESERVE_BYTES, Rc, RecordRun, Result, SCRATCH_FLOATS, + TAIL_ENTRIES, abi, aligned, checked, combine, ring_state, zero_bytes, +}; #[allow(unsafe_code)] #[path = "mtp_original_scalar_ffi.rs"] mod scalar_abi; diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill/graph_resources_original_graph_resources.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill/graph_resources_original_graph_resources.rs index f4337b9e..69b48cb1 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill/graph_resources_original_graph_resources.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill/graph_resources_original_graph_resources.rs @@ -1,8 +1,9 @@ //! Methods of `Scratch`: `new`. Methods of `Context`: `original_mtp_scalar_prefill`. //! Implements `Sealed for GraphResources`, `OriginalGraphResources for GraphResources`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, GraphResources, OriginalGraphResources, OriginalMtpScalarPrefill, Result, Scratch, aligned, checked, +}; impl crate::original_gpu_schedule::resources::Sealed for GraphResources<'_> {} impl OriginalGraphResources for GraphResources<'_> { diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill.rs index 7e186c2c..ea1666a8 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill.rs @@ -1,8 +1,16 @@ //! Groups the submodules `call_admission`, `group_capture`, `group_loop` and 5 more. //! Split out of `scalar` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, BufferHandle, Context, DeviceBuffer, DraftKvOutcome, ENTRIES, EmbeddingKind, Error, GR_ENTRIES, + KV_ENTRIES, LaunchShape, MAX_PROMPT, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_PINNED_HOST_BYTES, Module, + MtpInt8Snapshot, MtpOriginalInt8, NativeBatchWorkspace, OriginalDeviceResidual, OriginalGpuStream, + OriginalGraphKey, OriginalGraphRegistry, OriginalLayoutSetup, OriginalMtpEmbedding, OriginalMtpGrVariant, + OriginalMtpPrefill, OriginalMtpRetainedScalarWeights, OriginalMtpScalarPolicy, OriginalMtpScalarPrefill, + OriginalMtpScalarWeights, OriginalPromptRows, OriginalPromptSpan, OriginalStreamKind, Page, PrefillRows, + ProjectionBuffers, RESERVE_BYTES, Rc, RecordRun, RefCell, Result, SCALAR_FLAGS, ScalarCommand, + ScalarDraftKvSources, Scratch, TAIL_ENTRIES, checked, combine, mapped_records, zero_bytes, +}; #[path = "original_mtp_scalar_prefill/call_admission.rs"] mod call_admission; diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/call_admission.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/call_admission.rs index 5f4e10ac..dcfea80c 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/call_admission.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/call_admission.rs @@ -2,8 +2,13 @@ //! alias checks and weight staging, and the policy claim. The group loop is in `group_loop.rs` and the capture of one //! group in `group_capture.rs`. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, DraftKvOutcome, Error, ExternalOwners, MTP_ORIGINAL_MAX_CELLS, MtpInt8Snapshot, MtpOriginalInt8, + NativeBatchWorkspace, OriginalDeviceResidual, OriginalMtpEmbedding, OriginalMtpPrefill, + OriginalMtpRetainedScalarWeights, OriginalMtpScalarPolicy, OriginalMtpScalarPrefill, OriginalMtpScalarWeights, + OriginalPromptRows, OriginalPromptSpan, PrefillRows, Rc, RecordRun, Result, ScalarCall, ScalarDraftKvSources, + ScalarOperands, ScalarStaged, +}; /// Byte extents of the eleven weights: the ten of the MTP prefill and the GR inject matrix. const SCALAR_EXTENTS: [usize; 11] = [ diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/group_capture.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/group_capture.rs index 572d75a8..aeb6dee4 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/group_capture.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/group_capture.rs @@ -1,8 +1,9 @@ //! Capture of one group of `OriginalMtpScalarPrefill::record_impl` (STRA-338): the per-T forward owns fixed whole //! scratch/status and stable arguments; its commands are recorded in the order of the former single function. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Cap, EmbeddingKind, Error, LaunchShape, OriginalMtpScalarPrefill, ProjectionBuffers, Result, ScalarCommand, +}; impl<'ctx> OriginalMtpScalarPrefill<'ctx> { /// Captured per-T forward owns fixed whole scratch/status and stable arguments. diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/group_loop.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/group_loop.rs index f1a29081..cf5ddc9f 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/group_loop.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/group_loop.rs @@ -2,8 +2,12 @@ //! graph capture and enqueue, and the publication of the completed range. use super::super::graph::GroupSubmission; -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Cap, DraftKvOutcome, Error, GroupSpan, MtpOriginalInt8, NativeBatchWorkspace, OriginalGraphKey, + OriginalMtpPrefill, OriginalMtpRetainedScalarWeights, OriginalMtpScalarPrefill, OriginalPromptRows, + PagePublication, Rc, RecordRun, Result, ScalarCall, ScalarCommand, ScalarGroupSources, ScalarOperands, combine, + zero_bytes, +}; /// Fills the `[tokens n][steps4*n][positions24*n]` records of a prompt. fn fill_records(rec: &mut [u8], tokens: &[i32], cell0: usize) { diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/kernel_commands.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/kernel_commands.rs index 78239be3..001aba3c 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/kernel_commands.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/kernel_commands.rs @@ -1,8 +1,11 @@ //! The scratch layout accessors and the kernel command emitters (`kernel`, `finite`, `q8_guard`, `quant`, `project`, //! `gr_args`) of `OriginalMtpScalarPrefill` (STRA-338). -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, BufferHandle, DeviceBuffer, Error, ExternalOwners, LaunchShape, MTP_ORIGINAL_PINNED_HOST_BYTES, + Module, MtpOriginalInt8, OriginalGpuStream, OriginalMtpScalarPrefill, OriginalPromptSpan, ProjectionBuffers, Rc, + Result, SCALAR_FLAGS, ScalarCommand, checked, +}; impl<'ctx> OriginalMtpScalarPrefill<'ctx> { pub(in super::super) fn validate(&self) -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_admit_new.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_admit_new.rs index 1ffa6a0d..2263d6e5 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_admit_new.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_admit_new.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMtpScalarPrefill`: `assets_ready`, `planned_device_bytes`, `planned_host_bytes`, `host_metada... //! Split out of `original_mtp_scalar_prefill` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, ENTRIES, Error, GR_ENTRIES, KV_ENTRIES, MAX_PROMPT, MTP_ORIGINAL_MAX_CELLS, Module, OriginalGraphRegistry, + OriginalLayoutSetup, OriginalMtpScalarPrefill, OriginalStreamKind, RESERVE_BYTES, Rc, RefCell, Result, + SCALAR_FLAGS, Scratch, TAIL_ENTRIES, checked, combine, mapped_records, +}; impl<'ctx> OriginalMtpScalarPrefill<'ctx> { pub(in super::super) fn assets_ready() -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_close.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_close.rs index 15d879f1..3216a2e3 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_close.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_close.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalMtpScalarPrefill`: `close`, `close_inner`, `finish_host`, `close_stream` and 3 more. //! Split out of `original_mtp_scalar_prefill` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, Error, Module, OriginalGpuStream, OriginalMtpScalarPrefill, Rc, Result, combine}; impl<'ctx> OriginalMtpScalarPrefill<'ctx> { pub fn close(mut self) -> Result<()> { diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_record_gr.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_record_gr.rs index 0ec22c2a..912b0361 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_record_gr.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/original_mtp_scalar_prefill_record_gr.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMtpScalarPrefill`: `gr`, `gr_chunks`, `gr_chunk_kernel`, `record` and 1 more. //! Split out of `original_mtp_scalar_prefill` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, DraftKvOutcome, GrRows, LaunchShape, NativeBatchWorkspace, OriginalDeviceResidual, + OriginalMtpGrVariant, OriginalMtpScalarPolicy, OriginalMtpScalarPrefill, PrefillRows, RecordRun, Result, + ScalarCommand, ScalarDraftKvSources, combine, +}; impl<'ctx> OriginalMtpScalarPrefill<'ctx> { pub(in super::super) fn gr( diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/record_operands.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/record_operands.rs index c62832c8..2554ebc7 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/record_operands.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill/record_operands.rs @@ -1,8 +1,11 @@ //! Operands of `OriginalMtpScalarPrefill::record_impl` (STRA-338): the call, the staged weights and the addresses of //! one group of rows. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, MtpInt8Snapshot, MtpOriginalInt8, NativeBatchWorkspace, OriginalMtpEmbedding, + OriginalMtpRetainedScalarWeights, OriginalMtpScalarPolicy, OriginalMtpScalarPrefill, OriginalPromptRows, Page, Rc, + Result, ScalarCommand, +}; /// What the caller of `record_impl` supplies besides the buffers. pub(in super::super) struct ScalarCall<'a> { diff --git a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill_drop.rs b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill_drop.rs index abffb751..4559d79b 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill_drop.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_prefill/original_mtp_scalar_prefill_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for OriginalMtpScalarPrefill`. //! Split out of `scalar` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::OriginalMtpScalarPrefill; impl Drop for OriginalMtpScalarPrefill<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/mtp_original_scalar_weights.rs b/crates/cuda-driver/src/mtp_original_scalar_weights.rs index 5ab78c6c..763f4c3e 100644 --- a/crates/cuda-driver/src/mtp_original_scalar_weights.rs +++ b/crates/cuda-driver/src/mtp_original_scalar_weights.rs @@ -1,6 +1,9 @@ //! Private child of scalar producer. Genuine Rc whole-buffer retention, never a //! claim that caller bytes are valid model weights or source/finite authority. -use super::*; +use super::{ + Context, DeviceBuffer, EmbeddingKind, Error, OriginalMtpEmbedding, OriginalMtpPrefillWeights, + OriginalMtpScalarWeights, Rc, Result, checked, combine, +}; /// Root's binding-authenticated adapter supplies the actual eleven model owners /// and actual retained whole embedding owner, in Original record_forward order. /// Captured graphs retain this bank; temporary MtpMatrixRef is insufficient. diff --git a/crates/cuda-driver/src/mtp_original_session.rs b/crates/cuda-driver/src/mtp_original_session.rs index ed515171..2a91ea6a 100644 --- a/crates/cuda-driver/src/mtp_original_session.rs +++ b/crates/cuda-driver/src/mtp_original_session.rs @@ -1,6 +1,9 @@ //! Actual primary QSA geometry/RoPE borrow for Original MTP. No session or //! numerical completion is inferred from geometry; Root authenticates its actor. -use super::*; +use super::{ + BufferHandle, Cell, Context, DeviceBuffer, Error, F, FA, FM, LaunchShape, MTP_ORIGINAL_MAX_CELLS, + MTP_ORIGINAL_WINDOW, OriginalCapture, OriginalGraphResources, Rc, Result, checked, combine, +}; #[derive(Clone, Copy, Debug)] pub struct OriginalMtpSessionPlan { max_cells: usize, diff --git a/crates/cuda-driver/src/mtp_original_session/original_mtp_session_plan.rs b/crates/cuda-driver/src/mtp_original_session/original_mtp_session_plan.rs index cc410311..c9451841 100644 --- a/crates/cuda-driver/src/mtp_original_session/original_mtp_session_plan.rs +++ b/crates/cuda-driver/src/mtp_original_session/original_mtp_session_plan.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalMtpSessionPlan`: `from_primary`, `sized`, `max_cells`, `experts_per_token` and 11 more. //! Split out of `session_coupling` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Error, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_WINDOW, OriginalMtpSessionPlan, Result}; impl OriginalMtpSessionPlan { /// Pure literal mtp.cpp208–247 geometry; no allocation/canonical certificate. diff --git a/crates/cuda-driver/src/mtp_original_session/original_mtp_session_resources.rs b/crates/cuda-driver/src/mtp_original_session/original_mtp_session_resources.rs index 175fbf87..8f5aa733 100644 --- a/crates/cuda-driver/src/mtp_original_session/original_mtp_session_resources.rs +++ b/crates/cuda-driver/src/mtp_original_session/original_mtp_session_resources.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMtpSessionResources`: `retain_primary`, `check_primary`, `check_plan`, `check_tables` and 14 ... //! Methods of `SessionOwned`: `check_live`, `validate`. Functions: `session_native_asset`, `session_legacy_asset`. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Cell, Context, DeviceBuffer, Error, F, FA, FM, OriginalMtpRopeForm, OriginalMtpSessionPlan, + OriginalMtpSessionResources, OriginalMtpSessionRopePlan, Rc, Result, SESSION_LEGACY_ASSET_PIN, + SESSION_LEGACY_ENTRIES, SESSION_NATIVE_ASSET_PIN, SESSION_NATIVE_ENTRIES, SessionOwned, checked, combine, +}; /// How the session rope is computed: the table form and the six float constants of the rope scaling. #[derive(Clone, Copy)] diff --git a/crates/cuda-driver/src/mtp_original_session/session_owned_drop.rs b/crates/cuda-driver/src/mtp_original_session/session_owned_drop.rs index 411ac708..298fc04f 100644 --- a/crates/cuda-driver/src/mtp_original_session/session_owned_drop.rs +++ b/crates/cuda-driver/src/mtp_original_session/session_owned_drop.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalMtpSessionRopePlan`: `capture`. //! Implements `Drop for SessionOwned`, `Sealed for OriginalMtpSessionRopePlan` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, LaunchShape, OriginalCapture, OriginalGraphResources, OriginalMtpRopeForm, + OriginalMtpSessionRopePlan, Rc, Result, SessionOwned, checked, combine, session_legacy_asset, session_native_asset, +}; impl Drop for SessionOwned<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/native_head/dispatch.rs b/crates/cuda-driver/src/native_head/dispatch.rs index 1c8bb836..54f498dd 100644 --- a/crates/cuda-driver/src/native_head/dispatch.rs +++ b/crates/cuda-driver/src/native_head/dispatch.rs @@ -1,8 +1,7 @@ //! Functions: `dispatch`, `head_launch_shape`, `iq_columns`, `kind_geometry` and 3 more. //! Split out of `native_head` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Error, NativeHeadDispatch, Result}; pub(super) fn dispatch( kind: u32, n: usize, diff --git a/crates/cuda-driver/src/native_head/head_owned.rs b/crates/cuda-driver/src/native_head/head_owned.rs index c3af0882..f141902c 100644 --- a/crates/cuda-driver/src/native_head/head_owned.rs +++ b/crates/cuda-driver/src/native_head/head_owned.rs @@ -1,8 +1,12 @@ //! Methods of `HeadOwned`: `validate`, `close`, `is_released`, `leak_all` and 4 more. //! Methods of `Context`: `original_native_head`. Implements `Drop for HeadOwned`. -#[allow(unused_imports)] -use super::*; +use super::{ + Cell, Command, Context, DeviceBuffer, Error, HeadOwned, Kernels, NativeHeadDispatch, NativeHeadPayload, + NativeHeadProjectionFlight, OriginalGpuStream, OriginalNativeHead, OriginalNativeHeadRows, Rc, RefCell, Result, + admission, combine, geometry, iq_asset, native_asset, native_head_row_bytes, native_head_supported, + projection_commands, sampler_asset, +}; impl HeadOwned<'_> { pub(super) fn validate(&self, c: &Context<'_>) -> Result<()> { diff --git a/crates/cuda-driver/src/native_head/iq_entries_types.rs b/crates/cuda-driver/src/native_head/iq_entries_types.rs index 8c4a1d9a..82758dcb 100644 --- a/crates/cuda-driver/src/native_head/iq_entries_types.rs +++ b/crates/cuda-driver/src/native_head/iq_entries_types.rs @@ -1,8 +1,10 @@ //! Defines `OriginalNativeHeadGraphResources`, `NativeHeadProjectionFlight`. //! IQ_ENTRIES, SAMPLER_ENTRIES, OriginalNativeHeadGraphResources, NativeHeadProjectionFlight. -#[allow(unused_imports)] -use super::*; +use super::{ + Command, DeviceBuffer, OriginalGpuStream, OriginalGraphResources, OriginalNativeHead, OriginalNativeHeadRows, + Result, +}; pub(super) const IQ_ENTRIES: &[&str] = &[ "head_i7_old", diff --git a/crates/cuda-driver/src/native_head/native_asset.rs b/crates/cuda-driver/src/native_head/native_asset.rs index 5b4ea910..5b99f1e2 100644 --- a/crates/cuda-driver/src/native_head/native_asset.rs +++ b/crates/cuda-driver/src/native_head/native_asset.rs @@ -1,8 +1,10 @@ //! Methods of `NativeHeadDispatch`: `from_original_environment`. //! Methods of `Kernels`: `load`, `load_modules`, `module`, `close`. Implements `Default for NativeHeadDispatch`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Command, Context, DeviceBuffer, Error, IQ_ASSET_PIN, IQ_ENTRIES, Kernels, Module, NATIVE_ASSET_PIN, + NATIVE_ENTRIES, NativeHeadDispatch, RESERVE, Result, SAMPLER_ASSET_PIN, SAMPLER_ENTRIES, combine, +}; pub(super) fn native_asset() -> Option<&'static [u8]> { crate::sealed_ptx::pinned(concat!(include_str!("../native_head_native.ptx"), "\0").as_bytes(), NATIVE_ASSET_PIN) diff --git a/crates/cuda-driver/src/native_head/native_asset_pin_types.rs b/crates/cuda-driver/src/native_head/native_asset_pin_types.rs index e64f3400..fc73d156 100644 --- a/crates/cuda-driver/src/native_head/native_asset_pin_types.rs +++ b/crates/cuda-driver/src/native_head/native_asset_pin_types.rs @@ -1,8 +1,10 @@ //! Defines `NativeHeadSampling`, `NativeHeadPayload`, `NativeHeadDispatch` and 11 more. //! NATIVE_ASSET_PIN, IQ_ASSET_PIN, SAMPLER_ASSET_PIN, RESERVE, NativeHeadSampling, NativeHeadDispatch .... -#[allow(unused_imports)] -use super::*; +use super::{ + Cell, Command, Context, DeviceBuffer, MappedAllocation, Module, OriginalGpuStream, Rc, RefCell, SamplerParams, + SamplerPath, +}; // Only integration's pinned compiled Original assets can replace these None values. pub(super) const NATIVE_ASSET_PIN: Option<(usize, [u8; 32])> = Some(( diff --git a/crates/cuda-driver/src/native_head/native_entries_types.rs b/crates/cuda-driver/src/native_head/native_entries_types.rs index e8536c05..ecc08cbe 100644 --- a/crates/cuda-driver/src/native_head/native_entries_types.rs +++ b/crates/cuda-driver/src/native_head/native_entries_types.rs @@ -1,9 +1,6 @@ //! Items of the parent module. //! NATIVE_ENTRIES. -#[allow(unused_imports)] -use super::*; - pub(super) const NATIVE_ENTRIES: &[&str] = &[ "head_quant", "head_n2_s0", diff --git a/crates/cuda-driver/src/native_head/original_native_embed.rs b/crates/cuda-driver/src/native_head/original_native_embed.rs index 318ced7b..2a3cce94 100644 --- a/crates/cuda-driver/src/native_head/original_native_embed.rs +++ b/crates/cuda-driver/src/native_head/original_native_embed.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalNativeEmbed`: `validate_context`, `kind`, `bytes`, `is_mapped` and 6 more. //! Methods of `NativeEmbedFlight`: `wait`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Command, Context, DeviceBuffer, Error, NativeEmbedFlight, OriginalCapture, OriginalGpuStream, + OriginalNativeEmbed, OriginalNativeEmbedRows, Rc, RefCell, Result, address, admission, admit, cmd, combine, + disjoint, resources, transport, +}; impl<'ctx> OriginalNativeEmbed<'ctx> { pub fn validate_context(&self, c: &Context<'_>) -> Result<()> { diff --git a/crates/cuda-driver/src/native_head/original_native_embed_rows_original_graph.rs b/crates/cuda-driver/src/native_head/original_native_embed_rows_original_graph.rs index ebc3de68..ad400d94 100644 --- a/crates/cuda-driver/src/native_head/original_native_embed_rows_original_graph.rs +++ b/crates/cuda-driver/src/native_head/original_native_embed_rows_original_graph.rs @@ -1,8 +1,7 @@ //! Implements `OriginalGraphResources for OriginalNativeEmbedRows`. //! Split out of `native_head` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, OriginalGraphResources, OriginalNativeEmbedRows, Result}; impl OriginalGraphResources for OriginalNativeEmbedRows<'_> { fn validate_context(&self, c: &Context<'_>) -> Result<()> { diff --git a/crates/cuda-driver/src/native_head/original_native_head_rows.rs b/crates/cuda-driver/src/native_head/original_native_head_rows.rs index 6c4bdab6..3fd3d754 100644 --- a/crates/cuda-driver/src/native_head/original_native_head_rows.rs +++ b/crates/cuda-driver/src/native_head/original_native_head_rows.rs @@ -1,8 +1,12 @@ //! Groups the submodules `original_native_head_rows_greedy_submit`, `original_native_head_rows_sampling`. //! Split out of `native_head` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Cell, Command, Context, DeviceBuffer, Error, HeadOwned, MappedAllocation, NativeHeadFlight, + NativeHeadSampling, NativeHeadSelection, OriginalCapture, OriginalGpuStream, OriginalNativeHead, + OriginalNativeHeadRows, Rc, RefCell, Result, SamplerParams, SamplerPath, SamplingScratch, address, admission, + admit_history_prefix, cmd, combine, disjoint, greedy_entry, projection_commands, transport, +}; mod original_native_head_rows_greedy_submit; mod original_native_head_rows_sampling; diff --git a/crates/cuda-driver/src/native_head/original_native_head_rows/original_native_head_rows_greedy_submit.rs b/crates/cuda-driver/src/native_head/original_native_head_rows/original_native_head_rows_greedy_submit.rs index 77c618f5..b752b2df 100644 --- a/crates/cuda-driver/src/native_head/original_native_head_rows/original_native_head_rows_greedy_submit.rs +++ b/crates/cuda-driver/src/native_head/original_native_head_rows/original_native_head_rows_greedy_submit.rs @@ -1,8 +1,12 @@ //! Methods of `OriginalNativeHeadRows`: `new`, `allocate_buffers`, `set_finite_verdict_in_graph`, `finite_verdict_in... //! Functions: `sampling_needed`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Cell, Command, Context, DeviceBuffer, Error, HeadOwned, MappedAllocation, NativeHeadFlight, + NativeHeadSampling, NativeHeadSelection, OriginalCapture, OriginalGpuStream, OriginalNativeHead, + OriginalNativeHeadRows, Rc, RefCell, Result, SamplerParams, address, admission, admit_history_prefix, combine, + disjoint, greedy_entry, projection_commands, transport, +}; impl<'ctx> OriginalNativeHeadRows<'ctx> { pub(in super::super) fn new(head: Rc>, t: usize) -> Result { diff --git a/crates/cuda-driver/src/native_head/original_native_head_rows/original_native_head_rows_sampling.rs b/crates/cuda-driver/src/native_head/original_native_head_rows/original_native_head_rows_sampling.rs index 570a335b..302ef68b 100644 --- a/crates/cuda-driver/src/native_head/original_native_head_rows/original_native_head_rows_sampling.rs +++ b/crates/cuda-driver/src/native_head/original_native_head_rows/original_native_head_rows_sampling.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalNativeHeadRows`: `sample_commands`, `sample_args`, `history_shared_bytes`, `greedy_sample` an... //! Defines `SampleArgs`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Command, DeviceBuffer, Error, NativeHeadSampling, OriginalNativeHeadRows, Result, SamplerParams, SamplerPath, + SamplingScratch, address, admission, cmd, combine, greedy_entry, +}; impl<'ctx> OriginalNativeHeadRows<'ctx> { pub(in super::super) fn sample_commands( diff --git a/crates/cuda-driver/src/native_head/original_native_head_rows_drop_original_graph.rs b/crates/cuda-driver/src/native_head/original_native_head_rows_drop_original_graph.rs index 8eb55d0f..05449365 100644 --- a/crates/cuda-driver/src/native_head/original_native_head_rows_drop_original_graph.rs +++ b/crates/cuda-driver/src/native_head/original_native_head_rows_drop_original_graph.rs @@ -1,8 +1,11 @@ //! Methods of `NativeHeadFlight`: `finish`. //! Methods of `NativeHeadSelection`: `ids`, `position`, `vocabulary`, `into_ids`. -#[allow(unused_imports)] -use super::*; +use super::{ + Cell, Context, DeviceBuffer, EmbedOwned, Error, IQ_ENTRIES, MappedAllocation, Module, NativeHeadFlight, + NativeHeadSampling, NativeHeadSelection, OriginalGraphResources, OriginalNativeEmbed, OriginalNativeHeadRows, Rc, + Result, address, admission, combine, geometry, iq_asset, native_embed_supported, native_head_row_bytes, resources, +}; impl Drop for OriginalNativeHeadRows<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/native_head/original_native_head_rows_original_native.rs b/crates/cuda-driver/src/native_head/original_native_head_rows_original_native.rs index 48c1a297..8647add7 100644 --- a/crates/cuda-driver/src/native_head/original_native_head_rows_original_native.rs +++ b/crates/cuda-driver/src/native_head/original_native_head_rows_original_native.rs @@ -1,8 +1,10 @@ //! Methods of `NativeHeadProjectionFlight`: `wait`. //! Implements `OriginalNativeHeadGraphResources for OriginalNativeHeadRows`, `Drop for NativeHeadProjectionFlight`. -#[allow(unused_imports)] -use super::*; +use super::{ + NativeHeadProjectionFlight, OriginalNativeHeadGraphResources, OriginalNativeHeadRows, Result, iq_asset, + native_asset, sampler_asset, +}; impl<'ctx> OriginalNativeHeadGraphResources<'ctx> for OriginalNativeHeadRows<'ctx> { fn native_head_rows(&self) -> Result<&OriginalNativeHeadRows<'ctx>> { diff --git a/crates/cuda-driver/src/native_head/projection_commands.rs b/crates/cuda-driver/src/native_head/projection_commands.rs index 4fb4e7c1..5254da6d 100644 --- a/crates/cuda-driver/src/native_head/projection_commands.rs +++ b/crates/cuda-driver/src/native_head/projection_commands.rs @@ -1,8 +1,10 @@ //! Functions: `projection_commands`, `admit_projection`, `quant_command`, `head_command`. Defines `ProjectionBuffers`. //! Split out of `native_head` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Command, DeviceBuffer, Error, HeadOwned, Result, address, admit, cmd, disjoint, dispatch, + native_head_row_bytes, +}; pub(super) fn projection_commands( head: &HeadOwned<'_>, diff --git a/crates/cuda-driver/src/native_parity/native_parity_expert.rs b/crates/cuda-driver/src/native_parity/native_parity_expert.rs index 4cedb856..979cd24a 100644 --- a/crates/cuda-driver/src/native_parity/native_parity_expert.rs +++ b/crates/cuda-driver/src/native_parity/native_parity_expert.rs @@ -1,8 +1,9 @@ //! Methods of `NativeParityExpert`: `diagnostics`, `release`, `release_inner`. //! Methods of `Temporary`: `new`, `release`, `release_inner`. -#[allow(unused_imports)] -use super::*; +use super::{ + BenchResult, DeviceBuffer, Error, FF, H, NativeParityExpert, Rc, State, Temporary, bytes_i32, first, message, +}; impl<'ctx> NativeParityExpert<'ctx> { pub(super) fn diagnostics(&self) -> BenchResult<()> { diff --git a/crates/cuda-driver/src/native_parity/native_parity_operations.rs b/crates/cuda-driver/src/native_parity/native_parity_operations.rs index 1f4f325b..2be3f3af 100644 --- a/crates/cuda-driver/src/native_parity/native_parity_operations.rs +++ b/crates/cuda-driver/src/native_parity/native_parity_operations.rs @@ -2,8 +2,11 @@ //! enqueue. //! One impl split over these files so that each stays under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, Arg, BenchResult, Cell, Command, Context, DeviceBuffer, FF, H, Layout, NT, NativeParity, NativeParityExpert, + Rc, RefCell, State, Temporary, address, bytes_f32, bytes_i32, command, down_entry, first, floats, gu_entry, layout, + message, read, sealed_ptx, split, +}; mod native_parity_dequantize_diagnostics; mod native_parity_expert_enqueue; diff --git a/crates/cuda-driver/src/native_parity/native_parity_operations/native_parity_dequantize_diagnostics.rs b/crates/cuda-driver/src/native_parity/native_parity_operations/native_parity_dequantize_diagnostics.rs index 7725a53f..4ee5c541 100644 --- a/crates/cuda-driver/src/native_parity/native_parity_operations/native_parity_dequantize_diagnostics.rs +++ b/crates/cuda-driver/src/native_parity/native_parity_operations/native_parity_dequantize_diagnostics.rs @@ -1,8 +1,10 @@ //! Methods of `NativeParity`: `dequantize_expert_role`, `read_dequantized`, `embed_expert_gate`, `release_expert` an... //! Functions: `check_gate_rows`, `gate_embed_command`, `dequant_commands`, `q5_commands` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, BenchResult, Command, DeviceBuffer, FF, H, NativeParity, NativeParityExpert, Rc, Temporary, address, + bytes_f32, bytes_i32, command, first, floats, message, read, +}; fn check_gate_rows(rows: &[i32], e: &NativeParityExpert<'_>) -> BenchResult<()> { if rows.len() != FF || rows.iter().enumerate().any(|(i, &r)| r != (FF - 1 - i) as i32) || e.enqueued.get() { diff --git a/crates/cuda-driver/src/native_parity/native_parity_operations/native_parity_expert_enqueue.rs b/crates/cuda-driver/src/native_parity/native_parity_operations/native_parity_expert_enqueue.rs index 71641597..e8105ad5 100644 --- a/crates/cuda-driver/src/native_parity/native_parity_operations/native_parity_expert_enqueue.rs +++ b/crates/cuda-driver/src/native_parity/native_parity_operations/native_parity_expert_enqueue.rs @@ -1,8 +1,11 @@ //! Methods of `NativeParity`: `new`, `idle`, `expert`, `old_kernels` and 9 more. //! Functions: `expert_head_args`, `old_iq_mmvq`, `scratch_slots`, `gate_up_args` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, Arg, BenchResult, Cell, Command, Context, DeviceBuffer, H, Layout, NT, NativeParity, NativeParityExpert, Rc, + RefCell, State, address, bytes_f32, bytes_i32, command, down_entry, first, floats, gu_entry, layout, message, read, + sealed_ptx, split, +}; impl<'ctx> NativeParity<'ctx> { pub(in super::super) fn new(context: &'ctx Context<'ctx>) -> BenchResult { diff --git a/crates/cuda-driver/src/native_parity/parity_session.rs b/crates/cuda-driver/src/native_parity/parity_session.rs index 2df364d2..7b26b328 100644 --- a/crates/cuda-driver/src/native_parity/parity_session.rs +++ b/crates/cuda-driver/src/native_parity/parity_session.rs @@ -2,8 +2,10 @@ //! `Context::native_parity`. //! Apart from `native_parity_operations`, which holds the expert enqueue and the diagnostics. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, BenchResult, CString, Cell, Command, Context, DeviceBuffer, ENTRIES, NativeParity, RefCell, State, first, + message, +}; impl<'ctx> State<'ctx> { pub(super) fn healthy(&self) -> BenchResult<()> { diff --git a/crates/cuda-driver/src/native_parity/sealed_ptx.rs b/crates/cuda-driver/src/native_parity/sealed_ptx.rs index 02f4f393..aece3cb8 100644 --- a/crates/cuda-driver/src/native_parity/sealed_ptx.rs +++ b/crates/cuda-driver/src/native_parity/sealed_ptx.rs @@ -1,8 +1,7 @@ //! Functions: `sealed_ptx`, `message`, `first`, `native_parity_iq_supported` and 9 more. //! Split out of `native_parity` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Arg, BenchResult, Command, DeviceBuffer, FF, H, Layout, Result, SEALED_PTX_PIN}; pub(super) fn sealed_ptx() -> Option<&'static [u8]> { crate::sealed_ptx::pinned(concat!(include_str!("../native_parity.ptx"), "\0").as_bytes(), SEALED_PTX_PIN) diff --git a/crates/cuda-driver/src/native_prompt_device/original_device_block.rs b/crates/cuda-driver/src/native_prompt_device/original_device_block.rs index c2537031..dbeb7f9d 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_device_block.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_device_block.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalDeviceBlock`: `lease_identity`. //! Methods of `Context`: `original_prompt_device`, `original_ple_history`, `check_history_budget`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, GrNativeProfile, OriginalDeviceBlock, OriginalDeviceGrRead, OriginalDeviceResidual, + OriginalPleHistory, OriginalPromptDevice, OriginalPromptRows, PleBf16Mode, RESERVE, Result, S, bytes, combine, + encode, +}; impl OriginalDeviceBlock<'_, '_, '_> { pub fn lease_identity(&self) -> crate::OriginalPromptLeaseIdentity { diff --git a/crates/cuda-driver/src/native_prompt_device/original_ple_history.rs b/crates/cuda-driver/src/native_prompt_device/original_ple_history.rs index 746c3ea5..39b9d909 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_ple_history.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_ple_history.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalPleHistory`: `device`, `final_values`, `allocated_bytes`, `close` and 1 more. //! Methods of `LaunchGeometry`: `new`. Implements `Drop for OriginalPleHistory`. -#[allow(unused_imports)] -use super::*; +use super::{A, BufferHandle, C, DeviceBuffer, Error, KernelArguments, OriginalPleHistory, Result}; impl OriginalPleHistory<'_> { /// The verifier may retain this exact device history across a captured diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device.rs index acbd757c..4241598c 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device.rs @@ -1,8 +1,13 @@ //! Groups the submodules `gr_read_phases`, `inject_phases`, `original_prompt_device_apply_ple` and 8 more. //! Split out of `native_prompt_device` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, BufferHandle, C, Context, DeviceBuffer, Error, GR_ENTRIES, GR_PTX, GR_SHA, GrNativeProfile, GrNormRequest, + KernelModule, LaunchGeometry, NativeBatchWorkspace, OriginalDeviceBlock, OriginalDeviceGrRead, + OriginalDeviceNormedResidual, OriginalDeviceResidual, OriginalPleHistory, OriginalPromptDevice, OriginalPromptRows, + P, PACK_PTX, PLE_ENTRIES, PLE_PTX, PLE_SHA, PhaseGuards, PleBf16Mode, PleClosedWeights, RESERVE, Result, S, + ScanExtent, WeightExtent, bytes, combine, encode, fused_scans, kernel, scan_gr, scan_ple, +}; mod gr_read_phases; mod inject_phases; diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/gr_read_phases.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/gr_read_phases.rs index ae91f52f..6ec03f0e 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/gr_read_phases.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/gr_read_phases.rs @@ -1,7 +1,6 @@ //! STRA-338 size: the phases of `OriginalPromptDevice::read_gr_impl`, extracted in command order. -#[allow(unused_imports)] -use super::*; +use super::{A, BufferHandle, C, Error, LaunchGeometry, Result, ScanExtent, fused_scans, kernel, scan_gr}; pub(super) const GR_READ_ORDER: [usize; 7] = [0, 1, 2, 3, 6, 4, 5]; pub(super) const GR_READ_NAMES: [&str; 8] = [ diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/inject_phases.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/inject_phases.rs index 0ca3cd7a..d2fa4e61 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/inject_phases.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/inject_phases.rs @@ -1,7 +1,9 @@ //! STRA-338 size: the phases of `OriginalPromptDevice::{inject_gr, inject_gr_fused}`. -#[allow(unused_imports)] -use super::*; +use super::{ + A, BufferHandle, C, Error, GrNativeProfile, LaunchGeometry, NativeBatchWorkspace, OriginalPromptDevice, + OriginalPromptRows, PhaseGuards, Result, S, ScanExtent, fused_scans, kernel, scan_gr, +}; pub(super) const INJECT_NAMES: [&str; 8] = ["unused", "unused", "unused", "unused", "unused", "unused", "unused", "GR native candidate"]; diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_apply_ple.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_apply_ple.rs index e91f0c95..4db41df7 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_apply_ple.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_apply_ple.rs @@ -3,7 +3,9 @@ #[allow(unused_imports)] use super::ple_apply_phases::ple_commands; -use super::*; +use super::{ + NativeBatchWorkspace, OriginalDeviceResidual, OriginalPleHistory, OriginalPromptDevice, PleClosedWeights, Result, +}; impl<'ctx> OriginalPromptDevice<'ctx> { pub fn apply_ple<'arena, 'loan>( diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_bring_up.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_bring_up.rs index 382ceb6c..5dd99b92 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_bring_up.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_bring_up.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalPromptDevice`: `device_bytes`, `new`, `blank`, `init_resources` and 12 more. //! Functions: `check_sealed_assets`. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Context, DeviceBuffer, Error, GR_ENTRIES, GR_PTX, GR_SHA, GrNativeProfile, KernelModule, + NativeBatchWorkspace, OriginalDeviceResidual, OriginalPromptDevice, OriginalPromptRows, PACK_PTX, PLE_ENTRIES, + PLE_PTX, PLE_SHA, PleBf16Mode, RESERVE, Result, S, WeightExtent, combine, encode, +}; const COMMON_ROLES: [S; 12] = [ S::R, diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_close_modules.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_close_modules.rs index b4b2b8b7..43660c39 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_close_modules.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_close_modules.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalPromptDevice`: `close_inner`. Functions: `poison_on_error`, `close_module`, `release_owner`. //! Split out of `original_prompt_device` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, Error, KernelModule, OriginalPromptDevice, Result, combine}; impl<'ctx> OriginalPromptDevice<'ctx> { pub(in super::super) fn close_inner(&mut self) -> Result<()> { diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_gr_read_plan.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_gr_read_plan.rs index dcddd3d5..a55af5cb 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_gr_read_plan.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_gr_read_plan.rs @@ -3,7 +3,10 @@ #[allow(unused_imports)] use super::gr_read_phases::{GR_READ_NAMES, GR_READ_ORDER, GrReadPlan}; -use super::*; +use super::{ + BufferHandle, DeviceBuffer, Error, GrNativeProfile, GrNormRequest, NativeBatchWorkspace, OriginalDeviceGrRead, + OriginalDeviceResidual, OriginalPromptDevice, OriginalPromptRows, PhaseGuards, Result, S, WeightExtent, +}; impl<'ctx> OriginalPromptDevice<'ctx> { pub(in super::super) fn read_gr_impl<'arena, 'loan>( diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_initialize_rows.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_initialize_rows.rs index 5a92ba6b..7bc4957e 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_initialize_rows.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_initialize_rows.rs @@ -3,7 +3,10 @@ #[allow(unused_imports)] use super::run_phases::RunBuffers; -use super::*; +use super::{ + C, Error, NativeBatchWorkspace, OriginalDeviceResidual, OriginalPromptDevice, OriginalPromptRows, PhaseGuards, + Result, S, combine, +}; impl<'ctx> OriginalPromptDevice<'ctx> { /// `initialize` over the rows in place: each row's 10240 residual-stream values and 2560 PLE embedding diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_inject_gr.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_inject_gr.rs index 50639efc..8b49f5b7 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_inject_gr.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_inject_gr.rs @@ -3,7 +3,10 @@ #[allow(unused_imports)] use super::inject_phases::{inject_commands, inject_fused_commands}; -use super::*; +use super::{ + DeviceBuffer, Error, NativeBatchWorkspace, OriginalDeviceBlock, OriginalDeviceNormedResidual, + OriginalDeviceResidual, OriginalPromptDevice, Result, WeightExtent, +}; impl<'ctx> OriginalPromptDevice<'ctx> { /// A completed real attention/MoE producer moved the read lease into Block. diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_read_gr.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_read_gr.rs index 1809283f..7fd1d414 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_read_gr.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/original_prompt_device_read_gr.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalPromptDevice`: `read_gr`, `read_gr_normed`. //! Split out of `original_prompt_device` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + DeviceBuffer, Error, GrNormRequest, NativeBatchWorkspace, OriginalDeviceGrRead, OriginalDeviceNormedResidual, + OriginalDeviceResidual, OriginalPromptDevice, Result, +}; impl<'ctx> OriginalPromptDevice<'ctx> { pub fn read_gr<'arena, 'loan>( diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/ple_apply_phases.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/ple_apply_phases.rs index 53953b0a..119f387b 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/ple_apply_phases.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/ple_apply_phases.rs @@ -1,7 +1,10 @@ //! STRA-338 size: the phases of `OriginalPromptDevice::apply_ple`, extracted in call order. -#[allow(unused_imports)] -use super::*; +use super::{ + A, BufferHandle, C, Error, LaunchGeometry, NativeBatchWorkspace, OriginalPleHistory, OriginalPromptDevice, + OriginalPromptRows, P, PhaseGuards, PleBf16Mode, PleClosedWeights, Result, S, ScanExtent, WeightExtent, kernel, + scan_ple, +}; const PLE_ORDER: [usize; 10] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; const PLE_NAMES: [&str; 10] = [ diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/run_phases.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/run_phases.rs index 7f6d27a1..bd3e9ac3 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device/run_phases.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device/run_phases.rs @@ -1,7 +1,9 @@ //! STRA-338 size: the phases of `OriginalPromptDevice::run`, extracted in call order. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, C, Error, GR_ENTRIES, KernelModule, NativeBatchWorkspace, OriginalPromptDevice, OriginalPromptRows, + PLE_ENTRIES, Result, bytes, combine, +}; use crate::CurrentGuard; use crate::deferred_status::DeferredStatusCheck; use crate::ple_batch_ffi::Blas; diff --git a/crates/cuda-driver/src/native_prompt_device/original_prompt_device_drop.rs b/crates/cuda-driver/src/native_prompt_device/original_prompt_device_drop.rs index 4be360ed..04a3245c 100644 --- a/crates/cuda-driver/src/native_prompt_device/original_prompt_device_drop.rs +++ b/crates/cuda-driver/src/native_prompt_device/original_prompt_device_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for OriginalPromptDevice`. //! Split out of `native_prompt_device` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::OriginalPromptDevice; impl Drop for OriginalPromptDevice<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/native_prompt_device/stage_phases.rs b/crates/cuda-driver/src/native_prompt_device/stage_phases.rs index c074e3d9..76f6f6f4 100644 --- a/crates/cuda-driver/src/native_prompt_device/stage_phases.rs +++ b/crates/cuda-driver/src/native_prompt_device/stage_phases.rs @@ -1,5 +1,8 @@ //! STRA-338 size: the phases of `OriginalPromptDevice::initialize_staged`, extracted in call order. -use super::*; +use super::{ + A, BufferHandle, C, Error, LaunchGeometry, NativeBatchWorkspace, OriginalPromptDevice, OriginalPromptRows, + PhaseGuards, PromptInputStage, Result, S, ScanExtent, bytes, combine, kernel, scan_gr, +}; const STAGE_ORDER: [usize; 3] = [5, 6, 7]; const STAGE_NAMES: [&str; 8] = [ diff --git a/crates/cuda-driver/src/native_prompt_device_stage.rs b/crates/cuda-driver/src/native_prompt_device_stage.rs index 8cea10ab..844cfbce 100644 --- a/crates/cuda-driver/src/native_prompt_device_stage.rs +++ b/crates/cuda-driver/src/native_prompt_device_stage.rs @@ -1,7 +1,13 @@ //! Batched initial staging of an Original prompt chunk (child of `native_prompt_device`, which owns the private //! command/arena helpers used here). See `OriginalPromptDevice::initialize_staged`. use super::stage_phases::stage_commands; -use super::*; +use super::{ + DeviceBuffer, NativeBatchWorkspace, OriginalDeviceResidual, OriginalPromptDevice, OriginalPromptRows, Result, +}; +#[cfg(test)] +use super::{ + BufferHandle, CStr, Context, Error, GR_ENTRIES, GR_PTX, GrNativeProfile, PleBf16Mode, PleClosedWeights, S, bytes, +}; /// The chunk's initial rows in their cheap form: what `initialize_rows` would assemble on the host, as it is /// before assembly. diff --git a/crates/cuda-driver/src/original_expert_cache/original_cache_prefix.rs b/crates/cuda-driver/src/original_expert_cache/original_cache_prefix.rs index fb1d2605..fb1f213b 100644 --- a/crates/cuda-driver/src/original_expert_cache/original_cache_prefix.rs +++ b/crates/cuda-driver/src/original_expert_cache/original_cache_prefix.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalCachePrefix`: `completed_slot_span`. //! Methods of `Context`: `original_expert_cache_uniform`, `original_expert_cache_sized`. -#[allow(unused_imports)] -use super::*; +use super::{Context, OriginalCachePrefix, OriginalExpertCache, OriginalExpertSlots, Result, State}; impl OriginalCachePrefix<'_> { pub(crate) fn completed_slot_span(&self, layer: usize, expert: usize) -> Result> { diff --git a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_drop.rs b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_drop.rs index cefe73eb..63f2d2c2 100644 --- a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_drop.rs +++ b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for OriginalExpertCache`. //! Split out of `original_expert_cache` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::OriginalExpertCache; impl Drop for OriginalExpertCache<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations.rs b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations.rs index aec17e85..3a015c02 100644 --- a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations.rs +++ b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations.rs @@ -2,8 +2,11 @@ //! slot fill, open and slots, verify and lend. //! One impl split over these files so that each stays under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, MappedExpertBank, OriginalCachePrefix, OriginalExpertCache, OriginalExpertSlots, + OriginalPrefillArena, PrefillLayoutOptions, Rc, ResidentExpertBankSpan, Result, RetainedFill, State, TensorRole, + api, combine, ffi, +}; mod original_expert_cache_adaptive_swaps; mod original_expert_cache_batched_refill; diff --git a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_adaptive_swaps.rs b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_adaptive_swaps.rs index 9536a547..81fe90a8 100644 --- a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_adaptive_swaps.rs +++ b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_adaptive_swaps.rs @@ -2,8 +2,10 @@ //! Split out of `original_expert_cache_methods` to keep its files under the line limit. use super::original_expert_cache_open_and_slots::{check_total, span_layer}; -#[allow(unused_imports)] -use super::*; +use super::{ + Error, MappedExpertBank, OriginalExpertCache, Rc, ResidentExpertBankSpan, Result, RetainedFill, State, api, + combine, ffi, +}; impl<'ctx> OriginalExpertCache<'ctx> { /// `cudaEventRecord(adapt_ev, adapt_stream)` after a batch of swaps; nothing to do without swaps. diff --git a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_batched_refill.rs b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_batched_refill.rs index e6535cb6..60637f97 100644 --- a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_batched_refill.rs +++ b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_batched_refill.rs @@ -1,8 +1,9 @@ //! The lent-slot refill with batched copies (`LELEKA_REFILL_BATCH`, EXPERIMENTAL, off by default): the same pieces as //! `fill_slot_queued_on`, slot by slot and role by role, handed to `cuMemcpyBatchAsync_v2` in calls of a few hundred //! copies inside one context entry. The bytes, destinations and source order are those of the per-copy path. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, MappedExpertBank, OriginalExpertCache, Rc, ResidentExpertBankSpan, Result, RetainedFill, State, api, combine, +}; use crate::RefillBatchReport; use crate::refill_batch_copy::{HostCopy, issue_copies, per_copy}; diff --git a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_file_slot_fill.rs b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_file_slot_fill.rs index fb5533b8..5e9dc6a8 100644 --- a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_file_slot_fill.rs +++ b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_file_slot_fill.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalExpertCache`: `fill_file_slot_queued`, `check_file_queue`, `digest_conflict`, `owner_mismatch... //! Split out of `original_expert_cache_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, MappedExpertBank, OriginalExpertCache, Rc, ResidentExpertBankSpan, Result, RetainedFill, State, api, + combine, ffi, +}; impl<'ctx> OriginalExpertCache<'ctx> { /// Original contiguous G/U/D startup/refill: one actual H2D on the default diff --git a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_open_and_slots.rs b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_open_and_slots.rs index 8cfe2f29..c812c7bb 100644 --- a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_open_and_slots.rs +++ b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_open_and_slots.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalExpertCache`: `validate_file_source_context`, `completed_file_source_member`, `open`, `unopen... //! Functions: `span_layer`, `check_total`, `queue_span_copies`. Defines `SwapPlan`, `SlotRegion`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, MappedExpertBank, OriginalExpertCache, OriginalExpertSlots, Rc, ResidentExpertBankSpan, Result, + RetainedFill, State, TensorRole, api, combine, ffi, +}; impl<'ctx> OriginalExpertCache<'ctx> { pub(crate) fn validate_file_source_context(&self, c: &Context<'_>) -> Result<()> { diff --git a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_verify_and_lend.rs b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_verify_and_lend.rs index 3c5a2045..b776f767 100644 --- a/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_verify_and_lend.rs +++ b/crates/cuda-driver/src/original_expert_cache/original_expert_cache_operations/original_expert_cache_verify_and_lend.rs @@ -2,8 +2,10 @@ //! Split out of `original_expert_cache_methods` to keep its files under the line limit. use super::original_expert_cache_open_and_slots::span_layer; -#[allow(unused_imports)] -use super::*; +use super::{ + Error, MappedExpertBank, OriginalCachePrefix, OriginalExpertCache, OriginalPrefillArena, PrefillLayoutOptions, + ResidentExpertBankSpan, Result, State, combine, ffi, +}; impl<'ctx> OriginalExpertCache<'ctx> { /// Actual startup byte audit against the same retained source. Neither diff --git a/crates/cuda-driver/src/original_expert_stager/context.rs b/crates/cuda-driver/src/original_expert_stager/context.rs index eeeb366e..4562da3b 100644 --- a/crates/cuda-driver/src/original_expert_stager/context.rs +++ b/crates/cuda-driver/src/original_expert_stager/context.rs @@ -1,8 +1,13 @@ //! Methods of `Context`: `original_expert_stager`, `original_file_expert_stager`, `open_original_stager`, `abandon_s... //! Methods of `OriginalExpertStager`: `spawn_workers`. Functions: `shared_state`. Defines `StagerPlan`, `StagerTables`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arc, AtomicBool, AtomicU8, AtomicU64, AtomicUsize, Condvar, Context, Error, FileExpertSourceLease, FileSource, + HEADROOM, MAX_JOBS, Mutex, Ordering, OriginalExpertStager, OriginalStagerOptions, ResidentExpertBankLease, + ResidentExpertBankMember, Result, SOURCE_CAP, Shared, Slot, Source, WORKER_STACK, Work, abi, combine, metadata, + thread, worker, +}; +use super::available_memory; impl Context<'_> { pub fn original_expert_stager( diff --git a/crates/cuda-driver/src/original_expert_stager/original_expert_stager_lifecycle.rs b/crates/cuda-driver/src/original_expert_stager/original_expert_stager_lifecycle.rs index db78b04b..966ee952 100644 --- a/crates/cuda-driver/src/original_expert_stager/original_expert_stager_lifecycle.rs +++ b/crates/cuda-driver/src/original_expert_stager/original_expert_stager_lifecycle.rs @@ -2,8 +2,10 @@ //! and its `Drop`. //! Apart from `stager_workers`, which is the worker side. -#[allow(unused_imports)] -use super::*; +use super::{ + DeviceBuffer, Error, Flight, MAX_JOBS, Ordering, OriginalExpertStager, OriginalGpuStream, OriginalStagerBatch, + OriginalStagerCompleted, OriginalStagerJob, Result, Shared, Source, combine, +}; impl<'ctx> OriginalExpertStager<'ctx> { pub fn host_charge_bytes(&self) -> usize { diff --git a/crates/cuda-driver/src/original_expert_stager/original_stager_batch.rs b/crates/cuda-driver/src/original_expert_stager/original_stager_batch.rs index e9a557e7..dfdd9bee 100644 --- a/crates/cuda-driver/src/original_expert_stager/original_stager_batch.rs +++ b/crates/cuda-driver/src/original_expert_stager/original_stager_batch.rs @@ -1,8 +1,12 @@ //! Methods of `OriginalStagerBatch`: `len`, `is_empty`, `issue`, `issue_target` and 3 more. //! Methods of `OriginalStagerCompleted`: `into_parts`. Implements `Drop for OriginalStagerBatch`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, FileExpertSourceLease, HEADROOM, LayerRole, Ordering, OriginalExpertStager, + OriginalFileExpertBlob, OriginalGpuStream, OriginalStagerBatch, OriginalStagerCompleted, OriginalStagerJob, Result, + SOURCE_CAP, Source, abi, size_of, thread, +}; +use super::available_memory; impl<'ctx> OriginalStagerBatch<'_, 'ctx> { pub fn len(&self) -> usize { diff --git a/crates/cuda-driver/src/original_expert_stager/original_stager_options.rs b/crates/cuda-driver/src/original_expert_stager/original_stager_options.rs index f941f412..9c527e8a 100644 --- a/crates/cuda-driver/src/original_expert_stager/original_stager_options.rs +++ b/crates/cuda-driver/src/original_expert_stager/original_stager_options.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalStagerOptions`: `from_environment`, `dimensions`. //! Methods of `OriginalStagerJob`: `new`, `layer`, `expert`. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, FileSource, LayerRole, OriginalStagerJob, OriginalStagerOptions, ResidentExpertBankLease, + ResidentExpertBankMember, ResidentExpertBankSpan, Result, Source, TensorRole, abi, thread, +}; impl OriginalStagerOptions { pub fn from_environment() -> Self { diff --git a/crates/cuda-driver/src/original_expert_stager/stager_workers.rs b/crates/cuda-driver/src/original_expert_stager/stager_workers.rs index 561b6cba..d1b65f71 100644 --- a/crates/cuda-driver/src/original_expert_stager/stager_workers.rs +++ b/crates/cuda-driver/src/original_expert_stager/stager_workers.rs @@ -2,8 +2,11 @@ //! and ring-slot waits, and the host memory probe. //! Apart from `original_expert_stager_lifecycle`, which is the owner side. -#[allow(unused_imports)] -use super::*; +use super::{ + Active, Arc, AtomicBool, AtomicU8, DeviceBuffer, Error, Flight, JoinHandle, MAX_JOBS, META_CAP, Ordering, + OriginalExpertStager, OriginalStagerJob, Read, ResidentExpertBankMember, Result, Shared, Slot, abi, size_of, + stream_all, thread, +}; impl Shared { pub(super) fn fail(&self, error: Error) { diff --git a/crates/cuda-driver/src/original_expert_stager_ffi/api.rs b/crates/cuda-driver/src/original_expert_stager_ffi/api.rs index c689ca49..201a4a30 100644 --- a/crates/cuda-driver/src/original_expert_stager_ffi/api.rs +++ b/crates/cuda-driver/src/original_expert_stager_ffi/api.rs @@ -1,8 +1,10 @@ //! Methods of `Api`: `record`, `wait`, `copy_slot`, `load` and 13 more. Implements `Drop for Opening`. //! Functions: `symbol`. Defines `Opening`. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, BufferHandle, CStr, ContextHandle, Copy, Elapsed, Error, EventCreate, EventRecord, Handle, HandleCall, + HostAlloc, HostBuffer, Pop, Result, StreamEvent, StreamWait, WorkerSlot, c_void, check, +}; /// The dlopen reference of a half-built `Api`; closed on every early return of `load`. struct Opening(Handle); diff --git a/crates/cuda-driver/src/original_expert_stager_ffi/check.rs b/crates/cuda-driver/src/original_expert_stager_ffi/check.rs index 83564f29..3214ad0f 100644 --- a/crates/cuda-driver/src/original_expert_stager_ffi/check.rs +++ b/crates/cuda-driver/src/original_expert_stager_ffi/check.rs @@ -1,8 +1,7 @@ //! Implements `Drop for Api`. Functions: `check`. //! Split out of `original_stager` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Api, Error, Handle, Result}; pub(super) fn check(name: &'static str, code: i32) -> Result<()> { if code == 0 { Ok(()) } else { Err(Error::Driver { operation: name, code }) } diff --git a/crates/cuda-driver/src/original_expert_stager_ffi/host_buffer.rs b/crates/cuda-driver/src/original_expert_stager_ffi/host_buffer.rs index 2f37f60c..5e91a1ab 100644 --- a/crates/cuda-driver/src/original_expert_stager_ffi/host_buffer.rs +++ b/crates/cuda-driver/src/original_expert_stager_ffi/host_buffer.rs @@ -1,8 +1,7 @@ //! Methods of `HostBuffer`: `pinned`, `capacity`, `slot`. //! Methods of `CopyJob`: `from_slices`, `bytes`, `copy_to`, `copy_segment` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{CopyJob, Error, ExpertFileMap, HostBuffer, Result, WorkerSlot, c_void}; impl HostBuffer { pub(crate) fn pinned(&self) -> bool { diff --git a/crates/cuda-driver/src/original_file_expert_source/available_memory.rs b/crates/cuda-driver/src/original_file_expert_source/available_memory.rs index 6511b550..6c1de3fd 100644 --- a/crates/cuda-driver/src/original_file_expert_source/available_memory.rs +++ b/crates/cuda-driver/src/original_file_expert_source/available_memory.rs @@ -1,8 +1,7 @@ //! Functions: `available_memory`, `text`, `value`, `meminfo_available` and 6 more. //! Split out of `original_file_expert_source` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Error, Result}; #[cfg(unix)] use std::path::{Path, PathBuf}; diff --git a/crates/cuda-driver/src/original_file_expert_source/file_expert_source_swap_exchanges.rs b/crates/cuda-driver/src/original_file_expert_source/file_expert_source_swap_exchanges.rs index 17106870..ad134c52 100644 --- a/crates/cuda-driver/src/original_file_expert_source/file_expert_source_swap_exchanges.rs +++ b/crates/cuda-driver/src/original_file_expert_source/file_expert_source_swap_exchanges.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalFileExpertSource`: `reserve_exchanges`, `admit_exchanges`, `replace_exchange`, `stage_swaps` ... //! Implements `Drop for OriginalFileExpertSource`. Functions: `available_memory`. Defines `Candidate`. -#[allow(unused_imports)] -use super::*; +use super::{ + EXPERTS, Error, Exchange, N, NONE, OriginalExpertCache, OriginalFileExpertSource, OriginalSourceSwap, Result, abi, + combine, key, vec_filled, +}; impl Drop for OriginalFileExpertSource<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations.rs b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations.rs index 45219eb8..5cff1b8e 100644 --- a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations.rs +++ b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations.rs @@ -2,8 +2,12 @@ //! prefetch, stages and blobs, status counters, fill workers. //! One impl split over these files so that each stays under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + AtomicUsize, Context, EXPERTS, Error, Exchange, GIB, Instant, LAYERS, LayerRole, META_CAP, Mutex, N, NONE, + Ordering, OriginalExpertCache, OriginalFileExpertSource, OriginalFileSourceBlob, OriginalFileSourceCounters, + OriginalResidentOptions, Result, SOURCE_CAP, Stage, abi, combine, key, size_of, thread, vec_filled, +}; +use super::available_memory; mod build_phases; mod file_expert_source_cache_complement; diff --git a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/build_phases.rs b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/build_phases.rs index bcfb8762..e2dc03a9 100644 --- a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/build_phases.rs +++ b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/build_phases.rs @@ -2,7 +2,11 @@ #[allow(unused_imports)] use super::fill_workers::{run_fill_workers, straddling_cut}; -use super::*; +use super::{ + Context, EXPERTS, Error, GIB, LAYERS, META_CAP, N, NONE, OriginalExpertCache, OriginalFileExpertSource, + OriginalResidentOptions, Result, SOURCE_CAP, abi, combine, key, size_of, thread, vec_filled, +}; +use super::available_memory; use crate::CurrentGuard; type Primary = Vec<(i32, i32, usize)>; diff --git a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_cache_complement.rs b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_cache_complement.rs index 3ab3814f..a5ae47f1 100644 --- a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_cache_complement.rs +++ b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_cache_complement.rs @@ -3,7 +3,7 @@ #[allow(unused_imports)] use super::build_phases::{ArenaFillPlan, alloc_failed, discard_arena, leak_arena, poison_parts}; -use super::*; +use super::{Error, OriginalExpertCache, OriginalFileExpertSource, OriginalResidentOptions, Result, combine}; impl<'ctx> OriginalFileExpertSource<'ctx> { /// Genuine original primary cache membership, complete fill and Context fence, diff --git a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_prefetch.rs b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_prefetch.rs index b9def074..525f61db 100644 --- a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_prefetch.rs +++ b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_prefetch.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalFileExpertSource`: `prefetch_impl`, `prefetch_jobs`, `claim_prefetch`, `note_warm_hit` and 7 ... //! Functions: `fetch_worker`, `scoped_fetch`. Defines `FetchOutcomes`. -#[allow(unused_imports)] -use super::*; +use super::{ + AtomicUsize, EXPERTS, Error, Instant, LAYERS, Mutex, N, NONE, Ordering, OriginalFileExpertSource, Result, abi, + combine, thread, +}; impl<'ctx> OriginalFileExpertSource<'ctx> { pub(in super::super) fn prefetch_impl(&mut self, l: usize, experts: &[i64]) -> Result<()> { diff --git a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_stages_and_blobs.rs b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_stages_and_blobs.rs index 707d6858..d35bb7a1 100644 --- a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_stages_and_blobs.rs +++ b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_stages_and_blobs.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalFileExpertSource`: `plan`, `claim_stage`, `stage_victim`, `grow_stage` and 13 more. //! Functions: `omit_table`. -#[allow(unused_imports)] -use super::*; +use super::{ + EXPERTS, Error, Instant, LAYERS, N, NONE, OriginalFileExpertSource, OriginalFileSourceBlob, Result, Stage, abi, + key, size_of, vec_filled, +}; impl<'ctx> OriginalFileExpertSource<'ctx> { pub(in super::super) fn plan( diff --git a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_status_counters.rs b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_status_counters.rs index fa4a9fb9..932a5797 100644 --- a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_status_counters.rs +++ b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_status_counters.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalFileExpertSource`: `live`, `validate_context`, `parts`, `source_digest` and 15 more. //! Split out of `original_file_expert_source_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, Exchange, GIB, LAYERS, LayerRole, META_CAP, NONE, OriginalFileExpertSource, + OriginalFileSourceCounters, Result, SOURCE_CAP, Stage, abi, key, size_of, +}; +use super::available_memory; impl<'ctx> OriginalFileExpertSource<'ctx> { pub(in super::super) fn live(&self) -> Result<()> { diff --git a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/fill_workers.rs b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/fill_workers.rs index 83794bda..796dc5b3 100644 --- a/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/fill_workers.rs +++ b/crates/cuda-driver/src/original_file_expert_source/original_file_expert_source_operations/fill_workers.rs @@ -1,7 +1,6 @@ //! STRA-338 size: the fill workers of `OriginalFileExpertSource::build_cache_complement`. -#[allow(unused_imports)] -use super::*; +use super::{AtomicUsize, EXPERTS, Error, LAYERS, Mutex, NONE, Ordering, Result, abi, thread}; /// The first offset at or below `want` whose expert straddles `want`, else `want`. pub(super) fn straddling_cut(layer_bytes: &[usize; LAYERS], offsets: &[usize], want: usize) -> usize { diff --git a/crates/cuda-driver/src/original_file_expert_source/original_resident_options_and_blob.rs b/crates/cuda-driver/src/original_file_expert_source/original_resident_options_and_blob.rs index 37d8e877..0241d9e2 100644 --- a/crates/cuda-driver/src/original_file_expert_source/original_resident_options_and_blob.rs +++ b/crates/cuda-driver/src/original_file_expert_source/original_resident_options_and_blob.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalResidentOptions`: `from_environment`. //! Methods of `OriginalFileSourceBlob`: `bytes`, `layer`, `expert`, `source_digest` and 6 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Cell, Context, EXPERTS, Error, ExpertFileMap, FileExpertSourceLease, GIB, HashMap, LAYERS, LayerRole, N, + OriginalFileExpertSource, OriginalFileSourceBlob, OriginalFileSourceCounters, OriginalResidentOptions, Rc, Result, + abi, combine, +}; impl Default for OriginalResidentOptions { fn default() -> Self { diff --git a/crates/cuda-driver/src/original_file_expert_source_ffi/arena.rs b/crates/cuda-driver/src/original_file_expert_source_ffi/arena.rs index 299972b7..9fc8d5b3 100644 --- a/crates/cuda-driver/src/original_file_expert_source_ffi/arena.rs +++ b/crates/cuda-driver/src/original_file_expert_source_ffi/arena.rs @@ -1,8 +1,7 @@ //! Methods of `Arena`: `bytes`, `pin_limit`, `locked`, `lock_offset` and 5 more. //! Methods of `Copy`: `into_slice`, `run`. -#[allow(unused_imports)] -use super::*; +use super::{Arena, Copy, Error, P, Result}; impl Arena { pub(crate) fn bytes(&self) -> usize { diff --git a/crates/cuda-driver/src/original_file_expert_source_ffi/check.rs b/crates/cuda-driver/src/original_file_expert_source_ffi/check.rs index f2cfeb76..be9eecae 100644 --- a/crates/cuda-driver/src/original_file_expert_source_ffi/check.rs +++ b/crates/cuda-driver/src/original_file_expert_source_ffi/check.rs @@ -1,8 +1,7 @@ //! Methods of `Api`: `load`, `allocate`, `try_pinned`, `exchange_allocate` and 3 more. //! Implements `Drop for Opening`, `Drop for Api`. Functions: `check`, `symbol`. Defines `Opening`. -#[allow(unused_imports)] -use super::*; +use super::{Alias, Alloc, Api, Arc, Arena, ArenaSpan, CStr, DtoH, Error, Free, P, Register, Result}; pub(super) fn check(n: &'static str, c: i32) -> Result<()> { if c == 0 { Ok(()) } else { Err(Error::Driver { operation: n, code: c }) } diff --git a/crates/cuda-driver/src/original_gpu_head_bridge.rs b/crates/cuda-driver/src/original_gpu_head_bridge.rs index d827e351..9df2e501 100644 --- a/crates/cuda-driver/src/original_gpu_head_bridge.rs +++ b/crates/cuda-driver/src/original_gpu_head_bridge.rs @@ -1,6 +1,6 @@ //! Closed mutable head access ONLY after real graph launch and same-stream drain. //! Child of original_gpu_schedule; uses its actual private graph/stream owners. -use super::*; +use super::{Error, OriginalGpuGraph, OriginalGpuStream, Rc, Result}; use crate::{ DeviceBuffer, NativeHeadSampling, NativeHeadSelection, OriginalNativeHead, OriginalNativeHeadGraphResources, }; diff --git a/crates/cuda-driver/src/original_gpu_schedule/original_gpu_graph.rs b/crates/cuda-driver/src/original_gpu_schedule/original_gpu_graph.rs index 7ff072b8..68e200fb 100644 --- a/crates/cuda-driver/src/original_gpu_schedule/original_gpu_graph.rs +++ b/crates/cuda-driver/src/original_gpu_schedule/original_gpu_graph.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalGpuGraph`: `validate`, `nodes`, `policy`, `validate_context` and 14 more. //! Methods of `OriginalGraphFlight`: `query`, `wait`, `wait_ms`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Duration, Error, Instant, OriginalCapturePolicy, OriginalGpuEvent, OriginalGpuGraph, OriginalGpuStream, + OriginalGraphFlight, OriginalGraphResources, OriginalStreamDrained, OriginalWait, Rc, Result, abi, call, combine, + healthy, +}; impl<'ctx, R: OriginalGraphResources> OriginalGpuGraph<'ctx, R> { pub(super) fn validate(&self) -> Result { diff --git a/crates/cuda-driver/src/original_gpu_schedule/original_gpu_stream.rs b/crates/cuda-driver/src/original_gpu_schedule/original_gpu_stream.rs index dcc7a6c8..5ef95ac0 100644 --- a/crates/cuda-driver/src/original_gpu_schedule/original_gpu_stream.rs +++ b/crates/cuda-driver/src/original_gpu_schedule/original_gpu_stream.rs @@ -1,8 +1,12 @@ //! Methods of `OriginalGpuStream`: `validate_context`, `is_failed`, `priority`, `query` and 9 more. //! Split out of `original_gpu_schedule` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + CUDA_ERROR_OUT_OF_MEMORY, Cell, Context, Error, Instant, OriginalCapture, OriginalCapturePolicy, OriginalGpuGraph, + OriginalGpuStream, OriginalGraphResources, OriginalStreamDrained, Rc, Result, SIDE_STREAMS_WANTED, SideStreams, + abi, call, call_unless, capture_timing, combine, drop_side, injected_window_oom, is_graph_out_of_memory, make_side, + poison, transport, +}; mod capture_phases; diff --git a/crates/cuda-driver/src/original_gpu_schedule/original_gpu_stream/capture_phases.rs b/crates/cuda-driver/src/original_gpu_schedule/original_gpu_stream/capture_phases.rs index 5182dd3e..b45a102a 100644 --- a/crates/cuda-driver/src/original_gpu_schedule/original_gpu_stream/capture_phases.rs +++ b/crates/cuda-driver/src/original_gpu_schedule/original_gpu_stream/capture_phases.rs @@ -1,7 +1,10 @@ //! Phases of `OriginalGpuStream::capture_owned`, split out by STRA-338 size pass 2. -#[allow(unused_imports)] -use super::*; +use super::{ + CUDA_ERROR_OUT_OF_MEMORY, Cell, Context, Error, Instant, OriginalCapture, OriginalCapturePolicy, OriginalGpuGraph, + OriginalGpuStream, OriginalGraphResources, Result, SIDE_STREAMS_WANTED, SideStreams, abi, call, call_unless, + capture_timing, combine, drop_side, injected_window_oom, is_graph_out_of_memory, make_side, poison, +}; impl<'ctx> OriginalGpuStream<'ctx> { /// Validates the stream and resources, marks the stream as capturing and builds the (still empty) graph owner. diff --git a/crates/cuda-driver/src/original_gpu_schedule/original_graph_key.rs b/crates/cuda-driver/src/original_gpu_schedule/original_graph_key.rs index 8e0ff84a..abe3260f 100644 --- a/crates/cuda-driver/src/original_gpu_schedule/original_graph_key.rs +++ b/crates/cuda-driver/src/original_gpu_schedule/original_graph_key.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalGraphKey`: `validate`, `policy`. //! Methods of `OriginalGraphRegistry`: `new`, `planned_metadata_bytes`, `metadata_bytes`, `captures` and 7 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, OriginalCapture, OriginalCapturePolicy, OriginalGpuGraph, OriginalGpuStream, OriginalGraphKey, + OriginalGraphRegistry, OriginalGraphResources, Result, combine, healthy, +}; impl OriginalGraphKey { pub(super) fn validate(self) -> Result<()> { diff --git a/crates/cuda-driver/src/original_gpu_schedule/set_side_streams_wanted.rs b/crates/cuda-driver/src/original_gpu_schedule/set_side_streams_wanted.rs index 0ad79d65..108a45f8 100644 --- a/crates/cuda-driver/src/original_gpu_schedule/set_side_streams_wanted.rs +++ b/crates/cuda-driver/src/original_gpu_schedule/set_side_streams_wanted.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalCapture`: `has_side`, `side_fork`, `side_end`, `side_join` and 2 more. //! Methods of `OriginalGpuEvent`: `handle`, `validate_context`, `record`, `wait_on` and 6 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, OriginalCapture, OriginalEventKind, OriginalGpuEvent, OriginalGpuStream, Rc, Result, + SIDE_STREAMS_WANTED, SideStreams, abi, call, combine, healthy, +}; /// The next `VerifierWindow` capture creates the two side streams (SIDE_MIXER). Set by the window recorder around one /// recording. diff --git a/crates/cuda-driver/src/original_gpu_schedule/transport.rs b/crates/cuda-driver/src/original_gpu_schedule/transport.rs index 155a7165..9359b666 100644 --- a/crates/cuda-driver/src/original_gpu_schedule/transport.rs +++ b/crates/cuda-driver/src/original_gpu_schedule/transport.rs @@ -1,8 +1,10 @@ //! Methods of `Stream`: `bump`, `validate`, `run`, `close` and 1 more. //! Methods of `Context`: `original_default_gpu_stream`, `original_gpu_stream`, `original_gpu_event`. -#[allow(unused_imports)] -use super::*; +use super::{ + CUDA_ERROR_OUT_OF_MEMORY, Cell, Context, Error, OriginalCapturePolicy, OriginalEventKind, OriginalGpuEvent, + OriginalGpuStream, OriginalStreamKind, Rc, Result, Stream, abi, combine, +}; pub(super) fn transport(e: &Error) -> bool { match e { diff --git a/crates/cuda-driver/src/original_gpu_schedule_ffi/api.rs b/crates/cuda-driver/src/original_gpu_schedule_ffi/api.rs index 787f16b6..53e9707b 100644 --- a/crates/cuda-driver/src/original_gpu_schedule_ffi/api.rs +++ b/crates/cuda-driver/src/original_gpu_schedule_ffi/api.rs @@ -1,9 +1,6 @@ //! Methods of `Api`: `load`, `stream_create`, `stream_destroy`, `stream_sync` and 23 more. //! Split out of `abi` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; - #[cfg(not(all( feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), diff --git a/crates/cuda-driver/src/original_gpu_schedule_ffi/platform.rs b/crates/cuda-driver/src/original_gpu_schedule_ffi/platform.rs index c58691ce..2bf1ff75 100644 --- a/crates/cuda-driver/src/original_gpu_schedule_ffi/platform.rs +++ b/crates/cuda-driver/src/original_gpu_schedule_ffi/platform.rs @@ -1,7 +1,7 @@ //! Defines `Handle`, `Library`, `StreamCreate` and 21 more. //! Split out of `abi` to keep its files under the line limit. -use super::*; +use super::{Error, Result}; use std::ffi::{CStr, c_void}; type Handle = *mut c_void; struct Library(Handle); diff --git a/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/api.rs b/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/api.rs index 516037e8..0b3fe3bb 100644 --- a/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/api.rs +++ b/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/api.rs @@ -1,8 +1,13 @@ //! Methods of `Api`: `load`, `stream_create`, `warm_callback_thread`, `warm_callback_thread` and 19 more. //! Functions: `symbol`. -#[allow(unused_imports)] -use super::*; +use super::{ + Api, Begin, CStr, CopyBatch, CopyH2d, End, Error, EventCall, EventCreate, EventElapsed, EventRecord, GraphCall, + GraphStream, Handle, Instantiate, LaunchHostFn, Library, Nodes, Result, StreamCall, StreamCreate, StreamPriority, + StreamWait, WriteValue, check, +}; +#[cfg(target_os = "linux")] +use super::{callback_warmup_enabled, noop_host_fn}; fn symbol(l: &Library, n: &'static CStr) -> Result { // SAFETY: live dlopen handle and a NUL-terminated static symbol name. diff --git a/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/async_copies_and_flag_writes.rs b/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/async_copies_and_flag_writes.rs index 32c52eb5..0b9954fb 100644 --- a/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/async_copies_and_flag_writes.rs +++ b/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/async_copies_and_flag_writes.rs @@ -1,8 +1,7 @@ //! Methods of `Api`: `copy_h2d`, `copy_h2d_many`, `copy_h2d_batched`, `can_write_u32` and 3 more. //! Split out of `platform` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Api, BatchAttributes, CopyBatch, Error, Handle, Raise, Result, check, raise_after_copies}; impl Api { /// `cudaMemcpyAsync(H2D)` of `fetch_dma`. The caller keeps `src` (a registered bank) and `dst` alive diff --git a/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/library_drop.rs b/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/library_drop.rs index e68a9efb..70ce463e 100644 --- a/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/library_drop.rs +++ b/crates/cuda-driver/src/original_gpu_schedule_ffi/platform/library_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for Library`. Functions: `check`, `raise_after_copies`, `noop_host_fn`, `callback_warmup_enabled`. //! Split out of `platform` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Error, Library, Raise, Result, c_void}; impl Drop for Library { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/original_gpu_verify_bridge.rs b/crates/cuda-driver/src/original_gpu_verify_bridge.rs index 973b22f9..0b3c7ded 100644 --- a/crates/cuda-driver/src/original_gpu_verify_bridge.rs +++ b/crates/cuda-driver/src/original_gpu_verify_bridge.rs @@ -1,6 +1,6 @@ //! Child of original_gpu_schedule: consume a real post-window drain without an //! extra compute fence. Capture-only graphs never authorize head readback. -use super::*; +use super::{Error, OriginalGpuGraph, OriginalGpuStream, OriginalStreamDrained, Rc, Result}; use crate::original_verify::OriginalVerifyGraphResources; use crate::{NativeHeadSampling, NativeHeadSelection, OriginalNativeHeadGraphResources}; impl<'ctx, R: OriginalVerifyGraphResources<'ctx> + OriginalNativeHeadGraphResources<'ctx>> OriginalGpuGraph<'ctx, R> { diff --git a/crates/cuda-driver/src/original_moe_prompt_device/blank.rs b/crates/cuda-driver/src/original_moe_prompt_device/blank.rs index 1f97d961..c94da085 100644 --- a/crates/cuda-driver/src/original_moe_prompt_device/blank.rs +++ b/crates/cuda-driver/src/original_moe_prompt_device/blank.rs @@ -1,8 +1,10 @@ //! Methods of `Context`: `original_moe_prompt_device`. Functions: `blank`, `kernel`, `gemm`, `phase` and 2 more. //! Split out of `original_moe_prompt_device` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, BufferHandle, Command, Context, Error, GdnNativeFormat, GemmOperands, GemmSize, KernelArguments, + OriginalMoePromptDevice, OriginalPromptRows, PrefillPhase, Result, S, +}; pub(super) fn blank(n: usize) -> Result> { let mut v = Vec::new(); diff --git a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_drop.rs b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_drop.rs index 07b085cd..295a5020 100644 --- a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_drop.rs +++ b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_drop.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMoePromptLayer`: `experts`, `counts`, `metadata_bytes`, `execute_original_copy_ring` and 8 more. //! Implements `Drop for OriginalMoePromptDevice`. Functions: `source_in_layer`. -#[allow(unused_imports)] -use super::*; +use super::{ + A, BufferHandle, Command, Error, ExpertStreamLayer, MappedExpertBank, MmqWorkspace, NativeBatchWorkspace, + OriginalDeviceBlock, OriginalLayerExpertSources, OriginalMoePromptDevice, OriginalMoePromptLayer, PrefillPhase, + ResidentExpertBankSpan, Result, S, ScanTarget, blank, combine, common, kernel, phase, +}; impl Drop for OriginalMoePromptDevice<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations.rs b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations.rs index 29724a55..67877007 100644 --- a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations.rs +++ b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations.rs @@ -2,8 +2,12 @@ //! phases. //! One impl split over these files so that each stays under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, BufferHandle, Command, Context, DQ_ENTRIES, DeviceBuffer, Error, GdnNativeFormat, GemmOperands, GemmSize, + KernelArguments, KernelModule, MOE_ENTRIES, NativeBatchWorkspace, OriginalDeviceGrRead, OriginalMoePromptDevice, + OriginalMoePromptLayer, OriginalPromptRows, PrefillPhase, RESERVE, Result, S, SCRATCH, STATUS, ScanTarget, + SharedExpertLayout, StatusStaging, blank, combine, common, dequant_index, gemm, kernel, phase, +}; mod original_moe_prompt_device_new_run; mod original_moe_prompt_device_prepare; diff --git a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_new_run.rs b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_new_run.rs index 79b751da..87c6dfee 100644 --- a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_new_run.rs +++ b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_new_run.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMoePromptDevice`: `new`, `allocate_and_load`, `allocated_bytes`, `handle` and 9 more. //! Split out of `original_moe_prompt_device_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, BufferHandle, Command, Context, DQ_ENTRIES, DeviceBuffer, Error, KernelModule, MOE_ENTRIES, + NativeBatchWorkspace, OriginalMoePromptDevice, OriginalPromptRows, PrefillPhase, RESERVE, Result, S, SCRATCH, + STATUS, ScanTarget, StatusStaging, blank, combine, kernel, +}; use crate::ple_batch_ffi::{GemmDims, GemmOperands, GemmScalars, LinearLaunch}; impl<'ctx> OriginalMoePromptDevice<'ctx> { diff --git a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_prepare.rs b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_prepare.rs index 63cb6850..a76deaae 100644 --- a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_prepare.rs +++ b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_prepare.rs @@ -3,7 +3,10 @@ #[allow(unused_imports)] use super::prepare_phases::{MOE_NAMES, route_plan}; -use super::*; +use super::{ + DeviceBuffer, Error, NativeBatchWorkspace, OriginalDeviceGrRead, OriginalMoePromptDevice, OriginalMoePromptLayer, + Result, SharedExpertLayout, +}; impl<'ctx> OriginalMoePromptDevice<'ctx> { /// Weights are the actual router, shared scalar gate, shared gate/up/down. diff --git a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_release.rs b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_release.rs index 6d251939..9f29ad81 100644 --- a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_release.rs +++ b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/original_moe_prompt_device_release.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalMoePromptDevice`: `close_inner`, `is_released`, `retain_poisoned`. //! Split out of `original_moe_prompt_device_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Error, OriginalMoePromptDevice, Result, combine}; impl<'ctx> OriginalMoePromptDevice<'ctx> { pub(in super::super) fn close_inner(&mut self) -> Result<()> { diff --git a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/prepare_phases.rs b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/prepare_phases.rs index 747ee250..30c3d932 100644 --- a/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/prepare_phases.rs +++ b/crates/cuda-driver/src/original_moe_prompt_device/original_moe_prompt_device_operations/prepare_phases.rs @@ -1,7 +1,10 @@ //! STRA-338 size: the phases of `OriginalMoePromptDevice::prepare`, extracted in call order. -#[allow(unused_imports)] -use super::*; +use super::{ + A, BufferHandle, Command, DeviceBuffer, Error, GdnNativeFormat, GemmOperands, GemmSize, KernelArguments, + NativeBatchWorkspace, OriginalDeviceGrRead, OriginalMoePromptDevice, OriginalMoePromptLayer, OriginalPromptRows, + Result, S, SCRATCH, ScanTarget, blank, combine, common, dequant_index, gemm, kernel, phase, +}; pub(super) const MOE_NAMES: [&str; 8] = ["MixedH", "router", "route weights", "shared Gate", "shared Up", "shared SwiGLU", "shared Down", "shared scalar"]; diff --git a/crates/cuda-driver/src/original_mtp_actor_loaded/inconsistent.rs b/crates/cuda-driver/src/original_mtp_actor_loaded/inconsistent.rs index 55c1a8fb..e2688a35 100644 --- a/crates/cuda-driver/src/original_mtp_actor_loaded/inconsistent.rs +++ b/crates/cuda-driver/src/original_mtp_actor_loaded/inconsistent.rs @@ -1,8 +1,9 @@ //! Methods of `OriginalMtpLoadMeter`: `start`, `finish`. Functions: `inconsistent`, `mismatch`. //! Split out of `loaded` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, OriginalMtpDraftHead, OriginalMtpLoadEvidence, OriginalMtpLoadFailure, OriginalMtpLoadMeter, +}; pub(super) fn inconsistent(cause: Error) -> OriginalMtpLoadFailure { OriginalMtpLoadFailure::new("mtp: the loaded owners are inconsistent", Some(cause)) diff --git a/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor.rs b/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor.rs index cf1bd83f..9e19983b 100644 --- a/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor.rs +++ b/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor.rs @@ -1,8 +1,14 @@ //! Groups the submodules `draft_rounds`, `original_mtp_actor_adopt_loaded`. //! Split out of `loaded` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + AcceptedWindow, ActorRefusal, CompletedOriginalMtpDraft, Context, CoupledDraftHost, CoupledPlan, CoupledPreference, + CoupledSetupReceipt, DraftOutput, DraftSampling, DraftSettings, DraftTarget, Error, KvPlan, LoadedOwners, + MtpInt8Snapshot, MtpOriginalInt8, OriginalMtpActor, OriginalMtpDrafter, OriginalMtpFullPolicy, + OriginalMtpLoadEvidence, OriginalMtpLoadFailure, OriginalMtpLoadPlan, OriginalMtpLoadedParts, + OriginalMtpRetainedFullWeights, RepeatRowWindow, Result, SamplerParams, SetupDisposition, inconsistent, mismatch, + setup_disposition, +}; #[path = "original_mtp_actor/draft_rounds.rs"] mod draft_rounds; diff --git a/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor/draft_rounds.rs b/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor/draft_rounds.rs index 26ecb085..be795ca5 100644 --- a/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor/draft_rounds.rs +++ b/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor/draft_rounds.rs @@ -1,8 +1,11 @@ //! The draft rounds of `OriginalMtpActor` (STRA-338): `draft`, `draft_first` and the verifier-window forms, each taking //! the draft-round DTOs of `original_mtp_draft_round.rs`. -#[allow(unused_imports)] -use super::*; +use super::{ + AcceptedWindow, CompletedOriginalMtpDraft, DraftOutput, DraftSampling, DraftTarget, Error, MtpInt8Snapshot, + MtpOriginalInt8, OriginalMtpActor, OriginalMtpDrafter, OriginalMtpFullPolicy, RepeatRowWindow, Result, + SamplerParams, +}; impl<'ctx> OriginalMtpActor<'ctx> { pub(in super::super) fn staged_coupled(&self) -> Option<(SamplerParams, Box<[i32; 4096]>)> { diff --git a/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor/original_mtp_actor_adopt_loaded.rs b/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor/original_mtp_actor_adopt_loaded.rs index 2775fc10..aa3f2858 100644 --- a/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor/original_mtp_actor_adopt_loaded.rs +++ b/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor/original_mtp_actor_adopt_loaded.rs @@ -1,8 +1,12 @@ //! Methods of `OriginalMtpActor`: `adopt`, `admit`, `check_loaded`, `coupled_setup` and 22 more. //! Split out of `original_mtp_actor` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + ActorRefusal, Context, CoupledDraftHost, CoupledPlan, CoupledPreference, CoupledSetupReceipt, DraftSettings, Error, + KvPlan, LoadedOwners, MtpInt8Snapshot, MtpOriginalInt8, OriginalMtpActor, OriginalMtpDrafter, + OriginalMtpLoadEvidence, OriginalMtpLoadFailure, OriginalMtpLoadPlan, OriginalMtpLoadedParts, + OriginalMtpRetainedFullWeights, Result, SamplerParams, SetupDisposition, inconsistent, mismatch, setup_disposition, +}; impl<'ctx> OriginalMtpActor<'ctx> { /// End of `MtpDrafter::load` + `bind`: take ownership of the assembled diff --git a/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor_drop.rs b/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor_drop.rs index 8145c632..15c47de1 100644 --- a/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor_drop.rs +++ b/crates/cuda-driver/src/original_mtp_actor_loaded/original_mtp_actor_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for OriginalMtpActor`. //! Split out of `loaded` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::OriginalMtpActor; impl Drop for OriginalMtpActor<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/original_mtp_round_lifecycle.rs b/crates/cuda-driver/src/original_mtp_round_lifecycle.rs index 37506b73..da815c17 100644 --- a/crates/cuda-driver/src/original_mtp_round_lifecycle.rs +++ b/crates/cuda-driver/src/original_mtp_round_lifecycle.rs @@ -10,7 +10,11 @@ //! returns early for all-skipped groups, preallocates records to prompt_cap, and //! restores/materializes canonical snapshots. This file does not relabel those //! differences as literal public prefill parity. -use super::*; +use super::{ + CompletedOriginalMtpDraft, Error, FM, HOST_OFFSETS, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_WINDOW, MtpInt8Snapshot, + MtpOriginalInt8, MtpOriginalRingResources, OriginalDeviceResidual, OriginalMtpDrafter, PAGE_BYTES, Rc, Result, + combine, +}; use crate::original_mtp_actor::DraftSettings; const PUBLIC_HEADS: usize = 24; diff --git a/crates/cuda-driver/src/original_mtp_round_lifecycle/original_mtp_drafter.rs b/crates/cuda-driver/src/original_mtp_round_lifecycle/original_mtp_drafter.rs index 24dfd6f1..b5e5214d 100644 --- a/crates/cuda-driver/src/original_mtp_round_lifecycle/original_mtp_drafter.rs +++ b/crates/cuda-driver/src/original_mtp_round_lifecycle/original_mtp_drafter.rs @@ -1,8 +1,12 @@ //! Methods of `OriginalMtpDrafter`: `loaded_max_t`, `loaded_coupled`, `idle_public`, `plan_public_prefill` and 12 more. //! Functions: `resume_copies`, `fill_public_records`. -#[allow(unused_imports)] -use super::*; +use super::{ + CompletedOriginalMtpDraft, DraftSettings, Error, FM, HOST_OFFSETS, MTP_ORIGINAL_MAX_CELLS, MTP_ORIGINAL_WINDOW, + MtpInt8Snapshot, MtpOriginalInt8, MtpOriginalRingResources, OriginalDeviceResidual, OriginalMtpDrafter, + OriginalMtpPrefillPlan, OriginalMtpPrefillRequest, OriginalMtpPrefillSync, OriginalMtpResumePlan, PAGE_BYTES, + PUBLIC_HEADS, PUBLIC_RECORD_WORDS, Rc, Result, combine, public_step, +}; use crate::{AcceptedWindow, DraftOutput, DraftSampling, DraftTarget, RepeatRowWindow}; impl<'ctx> OriginalMtpDrafter<'ctx> { diff --git a/crates/cuda-driver/src/original_mtp_round_lifecycle/original_mtp_prefill_plan.rs b/crates/cuda-driver/src/original_mtp_round_lifecycle/original_mtp_prefill_plan.rs index 838ae15c..c80d797b 100644 --- a/crates/cuda-driver/src/original_mtp_round_lifecycle/original_mtp_prefill_plan.rs +++ b/crates/cuda-driver/src/original_mtp_round_lifecycle/original_mtp_prefill_plan.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalMtpPrefillPlan`: `residual`, `tokens`, `bulk_records`, `metadata_bytes` and 3 more. //! Methods of `OriginalMtpPrefillActions`: `group_action`, `bulk_action`, `mapped_action`. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, MTP_ORIGINAL_MAX_CELLS, MtpOriginalInt8, OriginalDeviceResidual, OriginalMtpPrefillAction, + OriginalMtpPrefillActions, OriginalMtpPrefillPlan, OriginalMtpPrefillSync, OriginalMtpResumePlan, PUBLIC_HEADS, + PUBLIC_RECORD_WORDS, PUBLIC_RESIDUAL_BYTES, Result, +}; impl<'source, 'arena, 'loan, 'ctx> OriginalMtpPrefillPlan<'source, 'arena, 'loan, 'ctx> { pub(crate) fn residual(&self) -> Option<&OriginalDeviceResidual<'arena, 'loan, 'ctx>> { diff --git a/crates/cuda-driver/src/original_mtp_round_lifecycle/public_draft_output_copy.rs b/crates/cuda-driver/src/original_mtp_round_lifecycle/public_draft_output_copy.rs index 263cffc8..b610acc8 100644 --- a/crates/cuda-driver/src/original_mtp_round_lifecycle/public_draft_output_copy.rs +++ b/crates/cuda-driver/src/original_mtp_round_lifecycle/public_draft_output_copy.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalMtpDrafter`: `copy_public_draft_output`. //! Split out of `round_lifecycle` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{CompletedOriginalMtpDraft, Error, OriginalMtpDrafter, Result}; impl<'ctx> OriginalMtpDrafter<'ctx> { pub(super) fn copy_public_draft_output( diff --git a/crates/cuda-driver/src/original_mtp_rt/read_index.rs b/crates/cuda-driver/src/original_mtp_rt/read_index.rs index 4efafeda..ae975026 100644 --- a/crates/cuda-driver/src/original_mtp_rt/read_index.rs +++ b/crates/cuda-driver/src/original_mtp_rt/read_index.rs @@ -1,8 +1,10 @@ //! Functions: `read_index`, `read_dense`, `expert_bank_bytes`, `expert_scales_finite` and 10 more. //! Split out of `original_mtp_rt` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + DENSE_LIMIT, DRAFT_VOCAB_MAX_IDS, DenseIndex, DraftVocab, EXPERT_SCALE_OFFSET, INDEX_LIMIT, Path, PathBuf, Read, + RtError, RtResult, StreamError, dv, open_regular, zeroed, +}; pub(crate) fn read_index(directory: &Path) -> RtResult { let open = || RtError::CannotOpenIndex { directory: directory.display().to_string() }; diff --git a/crates/cuda-driver/src/original_mtp_rt/rt_error.rs b/crates/cuda-driver/src/original_mtp_rt/rt_error.rs index a54760e4..d4e0a955 100644 --- a/crates/cuda-driver/src/original_mtp_rt/rt_error.rs +++ b/crates/cuda-driver/src/original_mtp_rt/rt_error.rs @@ -1,8 +1,7 @@ //! Methods of `RtError`: `message`, `index_message`, `pack_message`, `limit_message`. //! Methods of `OriginalMtpTensorKind`: `parse`, `index_name`, `row_bytes`. -#[allow(unused_imports)] -use super::*; +use super::{DenseIndex, File, MAX_TENSORS, OriginalMtpTensorKind, Path, RtError, RtResult, TensorEntry, fs}; impl RtError { /// Original error text where `mtp.cpp` has one, otherwise an `mtp:` text in diff --git a/crates/cuda-driver/src/original_prefill_arena/ple_extent.rs b/crates/cuda-driver/src/original_prefill_arena/ple_extent.rs index 4a2b43e6..aab2e3eb 100644 --- a/crates/cuda-driver/src/original_prefill_arena/ple_extent.rs +++ b/crates/cuda-driver/src/original_prefill_arena/ple_extent.rs @@ -1,7 +1,6 @@ //! The PLE span carve of the prompt arena, split out by STRA-338 size pass 2. -#[allow(unused_imports)] -use super::*; +use super::{Error, OriginalPleSpan, Result}; const PLE_SHAPES: [(OriginalPleSpan, usize, usize); 7] = [ (OriginalPleSpan::Key, 10240, 4), diff --git a/crates/cuda-driver/src/original_prefill_layout/carve_parts.rs b/crates/cuda-driver/src/original_prefill_layout/carve_parts.rs index 4b6129fa..108126d2 100644 --- a/crates/cuda-driver/src/original_prefill_layout/carve_parts.rs +++ b/crates/cuda-driver/src/original_prefill_layout/carve_parts.rs @@ -1,7 +1,6 @@ //! Carve helpers of the prefill layout, split out by STRA-338 size pass 2. -#[allow(unused_imports)] -use super::*; +use super::{Alloc, D, Error, N, Result, add, mul}; pub(super) fn take_kv_q4(a: &mut Alloc, rows: usize, head_dim: usize) -> Result<()> { if head_dim == 0 || !head_dim.is_multiple_of(32) { diff --git a/crates/cuda-driver/src/original_prefill_layout/mmq_identity.rs b/crates/cuda-driver/src/original_prefill_layout/mmq_identity.rs index 174c48a1..99b3cf8f 100644 --- a/crates/cuda-driver/src/original_prefill_layout/mmq_identity.rs +++ b/crates/cuda-driver/src/original_prefill_layout/mmq_identity.rs @@ -1,7 +1,6 @@ //! Size of the identity row table of the prompt MMQ launches (ledger row U3). -#[allow(unused_imports)] -use super::*; +use super::{K, Result, add, mul}; /// Widest column tile of the grouped MMQ launches (ggml `mul_mat_q_switch_J`: J = 8 .. 128 in steps of 8). const MMQ_TILE_COLS_MAX: usize = 128; diff --git a/crates/cuda-driver/src/original_sampler/asset.rs b/crates/cuda-driver/src/original_sampler/asset.rs index 81586a73..a4039aa8 100644 --- a/crates/cuda-driver/src/original_sampler/asset.rs +++ b/crates/cuda-driver/src/original_sampler/asset.rs @@ -1,8 +1,7 @@ //! Methods of `Launch`: `new`. Methods of `Context`: `original_sampler`. Functions: `asset`. //! Split out of `original_sampler` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ASSET_PIN, Arg, Command, Context, Launch, OriginalSampler, Result}; pub(super) fn asset() -> Option<&'static [u8]> { crate::sealed_ptx::pinned(concat!(include_str!("../original_sampler.ptx"), "\0").as_bytes(), ASSET_PIN) diff --git a/crates/cuda-driver/src/original_sampler/original_sampler_drop.rs b/crates/cuda-driver/src/original_sampler/original_sampler_drop.rs index 4fe76104..7601d557 100644 --- a/crates/cuda-driver/src/original_sampler/original_sampler_drop.rs +++ b/crates/cuda-driver/src/original_sampler/original_sampler_drop.rs @@ -1,8 +1,7 @@ //! Implements `Drop for OriginalSampler`. Functions: `sampler_asset_sealed`. //! Split out of `original_sampler` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{OriginalSampler, asset}; impl Drop for OriginalSampler<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/original_sampler/original_sampler_operations.rs b/crates/cuda-driver/src/original_sampler/original_sampler_operations.rs index 80d61941..0265434c 100644 --- a/crates/cuda-driver/src/original_sampler/original_sampler_operations.rs +++ b/crates/cuda-driver/src/original_sampler/original_sampler_operations.rs @@ -2,8 +2,10 @@ //! coupled draft, the verify window. //! One impl split over these files so that each stays under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Context, DRAFTS, DeviceBuffer, ENTRIES, Error, HIST, KernelModule, Launch, MappedAllocation, OriginalSampler, + RESERVE, Result, SampleRequest, SampleWindow, SamplerLaunchShape, SamplerParams, SamplerPath, asset, combine, +}; mod original_sampler_bring_up; mod original_sampler_close_resources; diff --git a/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_bring_up.rs b/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_bring_up.rs index e3bfd12e..87d9881c 100644 --- a/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_bring_up.rs +++ b/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_bring_up.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalSampler`: `new`, `unloaded`, `check_budget`, `allocate_and_load` and 11 more. //! Split out of `original_sampler_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DRAFTS, DeviceBuffer, ENTRIES, Error, HIST, KernelModule, MappedAllocation, OriginalSampler, RESERVE, + Result, asset, combine, +}; impl<'ctx> OriginalSampler<'ctx> { pub(in super::super) fn new( diff --git a/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_close_resources.rs b/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_close_resources.rs index 25dcc993..e165ef6b 100644 --- a/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_close_resources.rs +++ b/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_close_resources.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalSampler`: `close_inner`, `is_released`, `close_module_and_mapped`, `retain_module_and_mapped`. //! Functions: `release_buffer`. -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, Error, KernelModule, OriginalSampler, Result, combine}; impl<'ctx> OriginalSampler<'ctx> { pub(in super::super) fn close_inner(&mut self) -> Result<()> { diff --git a/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_coupled_draft.rs b/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_coupled_draft.rs index 80f10a49..1a0418a9 100644 --- a/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_coupled_draft.rs +++ b/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_coupled_draft.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalSampler`: `set_subset`, `stage_coupled_round`, `write_round_staging`, `launch_stage` and 11 m... //! Split out of `original_sampler_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Arg, DRAFTS, DeviceBuffer, Error, HIST, Launch, OriginalSampler, Result, SamplerParams, combine}; impl<'ctx> OriginalSampler<'ctx> { /// Install the actual draft-head vocabulary once. Empty means whole vocabulary. diff --git a/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_run_verify_window.rs b/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_run_verify_window.rs index 1330fb4a..07fa1fcf 100644 --- a/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_run_verify_window.rs +++ b/crates/cuda-driver/src/original_sampler/original_sampler_operations/original_sampler_run_verify_window.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalSampler`: `run`, `issue_guarded`, `launch_all`, `read_outputs` and 10 more. //! Methods of `SampleArgs`: `split_partial`, `greedy`, `old`, `fused`. Functions: `zeroed`, `split_merge`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Error, Launch, OriginalSampler, Result, SampleRequest, SampleWindow, SamplerLaunchShape, SamplerParams, + SamplerPath, combine, +}; impl<'ctx> OriginalSampler<'ctx> { pub(in super::super) fn run( diff --git a/crates/cuda-driver/src/original_session_state/add.rs b/crates/cuda-driver/src/original_session_state/add.rs index 8df2f808..4f889d7b 100644 --- a/crates/cuda-driver/src/original_session_state/add.rs +++ b/crates/cuda-driver/src/original_session_state/add.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalSessionGeometry`: `original`, `dimensions`, `validate`, `recurrence_bytes` and 14 more. //! Methods of `OriginalSessionSpan`: `end`, `at`. Functions: `add`, `mul`, `product`, `align` and 6 more. -#[allow(unused_imports)] -use super::*; +use super::{Cursor, Error, OriginalSessionGeometry, OriginalSessionQsaLayout, OriginalSessionSpan, Result}; pub(super) fn add(a: usize, b: usize) -> Result { a.checked_add(b).ok_or(Error::InvalidSize) diff --git a/crates/cuda-driver/src/original_session_state/original_session_layout.rs b/crates/cuda-driver/src/original_session_state/original_session_layout.rs index 201122a4..aa72834b 100644 --- a/crates/cuda-driver/src/original_session_state/original_session_layout.rs +++ b/crates/cuda-driver/src/original_session_state/original_session_layout.rs @@ -1,8 +1,12 @@ //! Methods of `OriginalSessionLayout`: `new`, `gdn_point_at`, `gdn_local_index`, `gdn_point_spans` and 1 more. //! Methods of `OriginalSessionState`: `session_init_carve`, `validate_context`, `layout`, `with_carved_arena` and 3 ... -#[allow(unused_imports)] -use super::*; +use super::{ + ALIGN, Context, Cursor, DeviceBuffer, Error, OriginalLayerBounds, OriginalSessionGeometry, OriginalSessionKvPolicy, + OriginalSessionLayout, OriginalSessionQsaLayout, OriginalSessionShape, OriginalSessionSpan, OriginalSessionState, + PLE_DIM, PLE_HIST, QsaPrice, Rc, Result, add, combine, mul, parts, product, qsa_carve, qsa_price, session_bytes, + sum16, +}; mod new_phases; use new_phases::Request; diff --git a/crates/cuda-driver/src/original_session_state/original_session_layout/new_phases.rs b/crates/cuda-driver/src/original_session_state/original_session_layout/new_phases.rs index f04c7d17..40cce725 100644 --- a/crates/cuda-driver/src/original_session_state/original_session_layout/new_phases.rs +++ b/crates/cuda-driver/src/original_session_state/original_session_layout/new_phases.rs @@ -1,7 +1,10 @@ //! Phases of `OriginalSessionLayout::new`, split out by STRA-338 size pass 2. -#[allow(unused_imports)] -use super::*; +use super::{ + ALIGN, Cursor, Error, OriginalSessionGeometry, OriginalSessionKvPolicy, OriginalSessionLayout, + OriginalSessionQsaLayout, OriginalSessionShape, OriginalSessionSpan, PLE_DIM, PLE_HIST, QsaPrice, Result, add, mul, + parts, product, qsa_carve, qsa_price, session_bytes, sum16, +}; /// The inputs of one layout request. #[derive(Clone, Copy)] diff --git a/crates/cuda-driver/src/original_session_state/qsa_price.rs b/crates/cuda-driver/src/original_session_state/qsa_price.rs index d7d860c5..d5868ad1 100644 --- a/crates/cuda-driver/src/original_session_state/qsa_price.rs +++ b/crates/cuda-driver/src/original_session_state/qsa_price.rs @@ -1,8 +1,11 @@ //! Methods of `PoolSizes`: `new`, `select`, `without_key`, `hybrid`. Methods of `KvSizes`: `new`. //! Functions: `qsa_price`, `kv_placement`, `tier_off`, `smaller_tier` and 11 more. -#[allow(unused_imports)] -use super::*; +use super::{ + ALIGN, Cursor, Error, OriginalSessionGeometry, OriginalSessionKvPolicy, OriginalSessionQsaLayout, + OriginalSessionShape, OriginalSessionSpan, PLE_DIM, PLE_HIST, QsaPrice, Result, add, align, mul, product, sum, + sum16, +}; pub(super) fn qsa_price( g: OriginalSessionGeometry, diff --git a/crates/cuda-driver/src/original_stream_all.rs b/crates/cuda-driver/src/original_stream_all.rs index c57090eb..7e96e57e 100644 --- a/crates/cuda-driver/src/original_stream_all.rs +++ b/crates/cuda-driver/src/original_stream_all.rs @@ -2,7 +2,12 @@ //! experts, even unused ones, advance in layer/expert order. This actor is //! private to a synchronous scope: a caller cannot forget an asynchronous //! guard and reuse/free the borrowed actual arena while its issuer is running. -use super::*; +use super::{ + Arc, AtomicBool, AtomicUsize, Error, HEADROOM, JoinHandle, MAX_JOBS, META_CAP, Mutex, Ordering, + OriginalExpertStager, OriginalGpuStream, Result, SOURCE_CAP, Shared, Source, WORKER_STACK, abi, combine, size_of, + thread, +}; +use super::available_memory; use crate::{OriginalPromptRows, ffi::BufferHandle}; const GPU_RING_MAX: usize = 512; #[derive(Clone, Copy)] diff --git a/crates/cuda-driver/src/original_stream_all/original_expert_stager.rs b/crates/cuda-driver/src/original_stream_all/original_expert_stager.rs index b2f89e55..51d376f8 100644 --- a/crates/cuda-driver/src/original_stream_all/original_expert_stager.rs +++ b/crates/cuda-driver/src/original_stream_all/original_expert_stager.rs @@ -1,8 +1,13 @@ //! Methods of `OriginalExpertStager`: `run_stream_all_forward`, `admit_forward`, `check_forward_caps`. //! Methods of `OriginalStreamAllForward`: `settle`, `validate_rows`, `with_compute`, `consume_layer` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Entry, Error, GPU_RING_MAX, HEADROOM, Issuer, JoinHandle, MAX_JOBS, META_CAP, OriginalExpertStager, + OriginalGpuStream, OriginalPromptRows, OriginalStreamAll, OriginalStreamAllCompleted, OriginalStreamAllForward, + OriginalStreamAllGatheredGroup, OriginalStreamAllGroupProducer, OriginalStreamAllMember, OriginalStreamAllOptions, + OriginalStreamAllPass, OriginalStreamPair, Result, SOURCE_CAP, Source, WORKER_STACK, combine, size_of, +}; +use super::available_memory; impl<'ctx> OriginalExpertStager<'ctx> { /// Moves the genuine physical row lease through the whole forward consumer. diff --git a/crates/cuda-driver/src/original_stream_all/original_stream_all_options.rs b/crates/cuda-driver/src/original_stream_all/original_stream_all_options.rs index ca75bf6e..c519bfd3 100644 --- a/crates/cuda-driver/src/original_stream_all/original_stream_all_options.rs +++ b/crates/cuda-driver/src/original_stream_all/original_stream_all_options.rs @@ -1,8 +1,14 @@ //! Groups the submodules `original_stream_all_options_issuer`, `original_expert_stager`, `original_stream_all` and 1... //! Split out of `stream_all` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arc, AtomicBool, AtomicUsize, BufferHandle, Entry, Error, EventBank, GPU_RING_MAX, HEADROOM, Issuer, JoinHandle, + MAX_JOBS, META_CAP, Mutex, ORIGINAL_MMQ_GROUP, Ordering, OriginalExpertStager, OriginalGpuStream, + OriginalPromptRows, OriginalStreamAll, OriginalStreamAllCompleted, OriginalStreamAllGatheredGroup, + OriginalStreamAllGroupProducer, OriginalStreamAllMember, OriginalStreamAllOptions, OriginalStreamAllPass, + OriginalStreamPair, Result, SOURCE_CAP, Shared, WORKER_STACK, abi, combine, size_of, thread, +}; +use super::available_memory; #[path = "original_stream_all_options/original_stream_all_options_issuer.rs"] mod original_stream_all_options_issuer; diff --git a/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_expert_stager.rs b/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_expert_stager.rs index 875f56b3..950f7a9b 100644 --- a/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_expert_stager.rs +++ b/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_expert_stager.rs @@ -3,7 +3,10 @@ #[allow(unused_imports)] use super::stream_phases::{arm_scope, finish_scope, open_scope, start_or_cleanup}; -use super::*; +use super::{ + Error, OriginalExpertStager, OriginalPromptRows, OriginalStreamAll, OriginalStreamAllCompleted, + OriginalStreamAllPass, OriginalStreamPair, Result, +}; impl<'ctx> OriginalExpertStager<'ctx> { /// Scope guarantees join/drain even on panic. No callback can extract the diff --git a/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all.rs b/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all.rs index 2a84a342..dd71ca58 100644 --- a/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all.rs +++ b/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalStreamAll`: `issue_inline`, `healthy`, `give_back`, `release_unused` and 5 more. //! Implements `Drop for OriginalStreamAll`. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Entry, Error, ORIGINAL_MMQ_GROUP, Ordering, OriginalGpuStream, OriginalStreamAll, + OriginalStreamAllGatheredGroup, OriginalStreamAllGroupProducer, OriginalStreamAllMember, Result, abi, combine, + thread, +}; #[path = "original_stream_all/walk.rs"] mod walk; diff --git a/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all/walk.rs b/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all/walk.rs index bdba04dc..6d2f460b 100644 --- a/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all/walk.rs +++ b/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all/walk.rs @@ -1,8 +1,10 @@ //! The shared walk of the global expert stream (`consume_layer` and its grouped form), split out by STRA-338 size pass //! 2. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Entry, Error, ORIGINAL_MMQ_GROUP, Ordering, OriginalGpuStream, OriginalStreamAll, + OriginalStreamAllGatheredGroup, OriginalStreamAllGroupProducer, OriginalStreamAllMember, Result, abi, thread, +}; /// What a streamed expert's callback gets: the issued entry, its ring slot, its target blob and the used event. pub(crate) struct Streamed<'a> { diff --git a/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all_options_issuer.rs b/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all_options_issuer.rs index 943aca93..bdb9d094 100644 --- a/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all_options_issuer.rs +++ b/crates/cuda-driver/src/original_stream_all/original_stream_all_options/original_stream_all_options_issuer.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalStreamAllOptions`: `from_environment`, `eligible`. Methods of `EventBank`: `retire`. //! Functions: `issuer_thread`, `issue_all`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arc, Error, EventBank, Issuer, Ordering, OriginalGpuStream, OriginalPromptRows, OriginalStreamAllCompleted, + OriginalStreamAllOptions, Result, Shared, abi, combine, thread, +}; impl OriginalStreamAllOptions { pub fn from_environment() -> Self { diff --git a/crates/cuda-driver/src/original_stream_all/original_stream_all_options/stream_phases.rs b/crates/cuda-driver/src/original_stream_all/original_stream_all_options/stream_phases.rs index d446a0a5..972b9d57 100644 --- a/crates/cuda-driver/src/original_stream_all/original_stream_all_options/stream_phases.rs +++ b/crates/cuda-driver/src/original_stream_all/original_stream_all_options/stream_phases.rs @@ -1,7 +1,12 @@ //! STRA-338 size: the phases of `OriginalExpertStager::run_stream_all`, extracted in call order. -#[allow(unused_imports)] -use super::*; +use super::{ + Arc, AtomicBool, AtomicUsize, BufferHandle, Entry, Error, EventBank, GPU_RING_MAX, HEADROOM, Issuer, JoinHandle, + MAX_JOBS, META_CAP, Mutex, Ordering, OriginalExpertStager, OriginalGpuStream, OriginalPromptRows, + OriginalStreamAll, OriginalStreamAllCompleted, OriginalStreamAllOptions, Result, SOURCE_CAP, WORKER_STACK, abi, + combine, issuer_thread, size_of, thread, +}; +use super::available_memory; /// Persistent Original RING_MAX copied/used bank. Constructor metadata /// reserves it; same real events/stage_live survive subsequent prompt chunks. diff --git a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal.rs b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal.rs index ddea0a28..32e83ce6 100644 --- a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal.rs +++ b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal.rs @@ -1,8 +1,13 @@ //! Groups the submodules `original_verify_window`, `verify_gdn_fused_step`, `verify_gdn_journal_ladder_logits_scan` ... //! Split out of `original_verify` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + ASSET, ASSET_SHA, Arg, Command, Context, DeviceBuffer, EPS, Error, LAYER_BYTES, Module, OriginalCapture, + OriginalGraphResources, OriginalVerifyBank, OriginalVerifyGdnJournal, OriginalVerifyGdnStage, + OriginalVerifyGeometry, OriginalVerifyGraphResources, OriginalVerifyResources, OriginalVerifyWindow, QSA_ASSET, + QSA_ASSET_SHA, Rc, Result, STATE_WORDS, admit, chain, check_commands, combine, command, draft, finite_verdict, + handle, kernels, poison, profile, resources, sealed_asset, transport, zero, +}; mod original_verify_window; mod verify_gdn_fused_step; diff --git a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/original_verify_window.rs b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/original_verify_window.rs index 79f58f9c..282c94d4 100644 --- a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/original_verify_window.rs +++ b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/original_verify_window.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalVerifyWindow`: `validate_mtp_geometry`, `retained_residual_address_for_mtp`, `actual_mtp_resi... //! Functions: `verify_assets_sealed`. -#[allow(unused_imports)] -use super::*; +use super::{ASSET, ASSET_SHA, Error, OriginalVerifyWindow, QSA_ASSET, QSA_ASSET_SHA, Result, handle, sealed_asset}; impl OriginalVerifyWindow<'_> { /// Structural geometry admission, not a numerical/session authority. diff --git a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_fused_step.rs b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_fused_step.rs index e4edcde5..2eb0029f 100644 --- a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_fused_step.rs +++ b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_fused_step.rs @@ -4,8 +4,7 @@ use super::super::gdn_fused::{AbUnrolledStep, FusedGdnBuffers, FusedGdnStep, GateSource, GdnGateOperands, RowSpan}; use super::verify_gdn_journal_stage_and_commit::StageOperands; -#[allow(unused_imports)] -use super::*; +use super::{EPS, Error, OriginalCapture, OriginalGraphResources, OriginalVerifyGdnJournal, Result, admit}; impl<'ctx> OriginalVerifyGdnJournal<'ctx> { /// One launch for the conv, the gates (computed inside unless `gates` says they are joined) and the recurrence of diff --git a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_ladder_logits_scan.rs b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_ladder_logits_scan.rs index 65d2218d..f38438f3 100644 --- a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_ladder_logits_scan.rs +++ b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_ladder_logits_scan.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalVerifyGdnJournal`: `capture_ladder`, `capture_ple_snapshot`, `validate_completed_logits`, `lo... //! Methods of `OriginalVerifyResources`: `new`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Command, Context, DeviceBuffer, Error, OriginalCapture, OriginalGraphResources, OriginalVerifyBank, + OriginalVerifyGdnJournal, OriginalVerifyGeometry, OriginalVerifyGraphResources, OriginalVerifyResources, Rc, + Result, admit, combine, command, finite_verdict, handle, poison, resources, transport, zero, +}; impl<'ctx> OriginalVerifyGdnJournal<'ctx> { /// Retain the actual PLE history after each chronological row, before its diff --git a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_stage_and_commit.rs b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_stage_and_commit.rs index 69e1a774..812d175d 100644 --- a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_stage_and_commit.rs +++ b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_stage_and_commit.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalVerifyGdnJournal`: `capture_layer_stage`, `stage_operands`, `stage_commands`, `stage_conv_com... //! Methods of `FusedSpans`: `launch`. Functions: `single_command`. Defines `StageOperands`, `FusedSpans`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Command, EPS, Error, LAYER_BYTES, OriginalCapture, OriginalGraphResources, OriginalVerifyGdnJournal, + OriginalVerifyGdnStage, Result, STATE_WORDS, admit, chain, command, draft, kernels, +}; impl<'ctx> OriginalVerifyGdnJournal<'ctx> { /// Exact batch convolution, BF16 MMVF alpha/beta, and recurrence. Canonical diff --git a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_window_launches.rs b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_window_launches.rs index 0770693a..ce3c4645 100644 --- a/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_window_launches.rs +++ b/crates/cuda-driver/src/original_verify/original_verify_gdn_journal/verify_gdn_journal_window_launches.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalVerifyGdnJournal`: `ple_buffer`, `submit`, `submit_qsa`, `submit_with` and 16 more. //! Functions: `launch_commands`, `admit_window_launches`, `window_module`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Command, Context, DeviceBuffer, Error, Module, OriginalCapture, OriginalVerifyGdnJournal, Rc, Result, chain, + check_commands, command, handle, kernels, poison, profile, transport, +}; impl<'ctx> OriginalVerifyGdnJournal<'ctx> { /// The device history image the window rows advance (and the commit graph sets from `hist_snap`): the one buffer diff --git a/crates/cuda-driver/src/original_verify/original_verify_rearm.rs b/crates/cuda-driver/src/original_verify/original_verify_rearm.rs index ad4d1852..c8d27988 100644 --- a/crates/cuda-driver/src/original_verify/original_verify_rearm.rs +++ b/crates/cuda-driver/src/original_verify/original_verify_rearm.rs @@ -15,7 +15,12 @@ //! //! The verifier side (`park`, `rearm`, its preconditions and counters) is //! `original_verify_schedule/verifier_park_rearm.rs`. -use super::*; +use super::{ + DeviceBuffer, Error, OriginalVerifyBank, OriginalVerifyLayout, Physical, Result, check_canonical_lengths, combine, + handle, poison, transport, +}; +#[cfg(test)] +use super::{kernels, profile_stamp_words}; /// The PLE history image: nine rows of `10240` f32 (the commit graph's `hist_snap` row). const PLE_HISTORY_WORDS: usize = 9 * 10240; diff --git a/crates/cuda-driver/src/original_verify/share_window_modules.rs b/crates/cuda-driver/src/original_verify/share_window_modules.rs index 0fbf4967..632527de 100644 --- a/crates/cuda-driver/src/original_verify/share_window_modules.rs +++ b/crates/cuda-driver/src/original_verify/share_window_modules.rs @@ -1,8 +1,13 @@ //! Groups the submodules `verify_bank_and_canonical_gdn_open`, `original_verify_bank`, `physical` and 1 more. //! Split out of `original_verify` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + ASSET, ASSET_SHA, Arg, CANONICAL_BYTES, Canonical, Cell, Command, Context, DeviceBuffer, DeviceRef, ENTRIES, Error, + HISTORY_WORDS, LAYER_BYTES, MappedAllocation, Module, OriginalGraphResources, OriginalVerifyBank, + OriginalVerifyCanonicalGdn, OriginalVerifyGdnJournal, OriginalVerifyGdnWeights, OriginalVerifyGeometry, + OriginalVerifyLayout, OriginalVerifyRow, OriginalVerifyWindow, Physical, QSA_ASSET, QSA_ASSET_SHA, QSA_ENTRIES, + RESERVE, Rc, RefCell, Result, STATE_WORDS, StagedWindow, combine, diag, kernels, profile, resources, +}; mod verify_bank_and_canonical_gdn_open; #[allow(unused_imports)] diff --git a/crates/cuda-driver/src/original_verify/share_window_modules/original_verify_bank.rs b/crates/cuda-driver/src/original_verify/share_window_modules/original_verify_bank.rs index b0675ff1..da0a506e 100644 --- a/crates/cuda-driver/src/original_verify/share_window_modules/original_verify_bank.rs +++ b/crates/cuda-driver/src/original_verify/share_window_modules/original_verify_bank.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalVerifyBank`: `new`, `staged_window`, `staged_keep`, `completed_row` and 14 more. //! Split out of `share_window_modules` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + ASSET, ASSET_SHA, Context, Error, OriginalVerifyBank, OriginalVerifyGeometry, OriginalVerifyLayout, + OriginalVerifyRow, Physical, QSA_ASSET, QSA_ASSET_SHA, Rc, Result, StagedWindow, admission, combine, diag, + sealed_asset, +}; impl<'ctx> OriginalVerifyBank<'ctx> { pub(in super::super) fn new(context: &'ctx Context<'ctx>, geometry: OriginalVerifyGeometry) -> Result { diff --git a/crates/cuda-driver/src/original_verify/share_window_modules/physical.rs b/crates/cuda-driver/src/original_verify/share_window_modules/physical.rs index ec4f4ffd..844716f7 100644 --- a/crates/cuda-driver/src/original_verify/share_window_modules/physical.rs +++ b/crates/cuda-driver/src/original_verify/share_window_modules/physical.rs @@ -1,8 +1,10 @@ //! Methods of `Physical`: `validate`, `span`, `ensure_window_assets`, `select_ready` and 15 more. //! Implements `Drop for Physical`. Functions: `group_specs`, `reuse_loaded`. Defines `WindowGroup`, `ReadyModule`. -#[allow(unused_imports)] -use super::*; +use super::{ + Cell, Context, DeviceBuffer, ENTRIES, Error, MappedAllocation, Module, OriginalVerifyLayout, Physical, QSA_ENTRIES, + Rc, RefCell, Result, admission, admit, combine, handle, kernels, poison, profile, share_window_modules, transport, +}; impl Physical<'_> { pub(in super::super) fn validate(&self, c: &Context<'_>) -> Result<()> { diff --git a/crates/cuda-driver/src/original_verify/share_window_modules/verify_bank_and_canonical_gdn_open.rs b/crates/cuda-driver/src/original_verify/share_window_modules/verify_bank_and_canonical_gdn_open.rs index d25c191c..e9c57ef3 100644 --- a/crates/cuda-driver/src/original_verify/share_window_modules/verify_bank_and_canonical_gdn_open.rs +++ b/crates/cuda-driver/src/original_verify/share_window_modules/verify_bank_and_canonical_gdn_open.rs @@ -1,8 +1,11 @@ //! Methods of `Context`: `original_verify_canonical_gdn`, `original_verify_bank`. //! Methods of `Canonical`: `upload_layers`, `reseed`, `allocated_bytes`, `validate_context` and 4 more. -#[allow(unused_imports)] -use super::*; +use super::{ + ASSET, ASSET_SHA, Arg, CANONICAL_BYTES, Canonical, Cell, Command, Context, DeviceBuffer, ENTRIES, Error, + HISTORY_WORDS, LAYER_BYTES, Module, OriginalVerifyBank, OriginalVerifyCanonicalGdn, OriginalVerifyGeometry, + RESERVE, Rc, Result, STATE_WORDS, combine, +}; /// `LELEKA_WINDOW_MODULE_CACHE=off`: every verifier bank loads its window modules again (A/B control). pub(in super::super) fn share_window_modules() -> bool { diff --git a/crates/cuda-driver/src/original_verify/share_window_modules/verify_bank_plan_and_window_rows.rs b/crates/cuda-driver/src/original_verify/share_window_modules/verify_bank_plan_and_window_rows.rs index b3bada9e..7c1b10b5 100644 --- a/crates/cuda-driver/src/original_verify/share_window_modules/verify_bank_plan_and_window_rows.rs +++ b/crates/cuda-driver/src/original_verify/share_window_modules/verify_bank_plan_and_window_rows.rs @@ -1,8 +1,12 @@ //! Methods of `OriginalVerifyBank`: `read_profile`, `doorbell_sequence`, `publish_empty_plan`, `zero_plan_header` an... //! Methods of `OriginalVerifyRow`: `position`, `validate_context`, `residual`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, DeviceRef, Error, MappedAllocation, OriginalGraphResources, OriginalVerifyBank, + OriginalVerifyCanonicalGdn, OriginalVerifyGdnJournal, OriginalVerifyGdnWeights, OriginalVerifyRow, + OriginalVerifyWindow, Rc, RefCell, Result, admit, combine, handle, kernels, poison, profile, resources, transport, + zero, +}; impl<'ctx> OriginalVerifyBank<'ctx> { /// The window's GPU stage stamps, read only after the genuine post-window fences. diff --git a/crates/cuda-driver/src/original_verify_gpu_plan.rs b/crates/cuda-driver/src/original_verify_gpu_plan.rs index e1cf205f..c2877be5 100644 --- a/crates/cuda-driver/src/original_verify_gpu_plan.rs +++ b/crates/cuda-driver/src/original_verify_gpu_plan.rs @@ -14,7 +14,7 @@ //! completed and whose owner is the routed expert of every entry of the group (checked against the mapped ids //! the doorbell published), a PCIe group names the three registered bank spans of that same expert. use super::window_plan::{PlanLayout, staging_blobs_per_group}; -use super::*; +use super::{Error, Rc, Result, schedule}; use crate::{MappedExpertBank, OriginalExpertCache, OriginalGpuStream}; use leleka_model_format::qwen4exp::{ResidentExpertBankSpan, TensorRole}; diff --git a/crates/cuda-driver/src/original_verify_gpu_plan/cpu_sink_publish_gpu_plan.rs b/crates/cuda-driver/src/original_verify_gpu_plan/cpu_sink_publish_gpu_plan.rs index 3db4acdb..181354a5 100644 --- a/crates/cuda-driver/src/original_verify_gpu_plan/cpu_sink_publish_gpu_plan.rs +++ b/crates/cuda-driver/src/original_verify_gpu_plan/cpu_sink_publish_gpu_plan.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalVerifyCpuSink`: `plan_capacity`, `staging_capacity`, `copies_landed`, `group_ids` and 1 more. //! Functions: `dma_options`. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, OriginalExpertCache, OriginalGpuStream, OriginalVerifyGpuPlan, OriginalVerifyPcieSource, Result, + dma_options_for, schedule, staging_blobs_per_group, +}; impl<'ctx> schedule::OriginalVerifyCpuSink<'_, 'ctx> { /// The plan block's entry capacity (`GpuPlanSink::cap` = `max_t * k`). diff --git a/crates/cuda-driver/src/original_verify_gpu_plan/dma_options_for.rs b/crates/cuda-driver/src/original_verify_gpu_plan/dma_options_for.rs index 6b208c55..6479ae08 100644 --- a/crates/cuda-driver/src/original_verify_gpu_plan/dma_options_for.rs +++ b/crates/cuda-driver/src/original_verify_gpu_plan/dma_options_for.rs @@ -1,9 +1,6 @@ //! Functions: `dma_options_for`. //! Split out of `gpu_plan` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; - /// `dma_options` for a platform and an environment: `wsl` (WSL2 passthrough) makes the batch copy and the stream /// write opt-in, `windows` (native) the batch copy only. pub(super) fn dma_options_for(wsl: bool, windows: bool, env: impl Fn(&str) -> String) -> (bool, bool, bool) { diff --git a/crates/cuda-driver/src/original_verify_gpu_plan/original_verify_gpu_plan_encoding.rs b/crates/cuda-driver/src/original_verify_gpu_plan/original_verify_gpu_plan_encoding.rs index 98bc3ac6..a0796ba0 100644 --- a/crates/cuda-driver/src/original_verify_gpu_plan/original_verify_gpu_plan_encoding.rs +++ b/crates/cuda-driver/src/original_verify_gpu_plan/original_verify_gpu_plan_encoding.rs @@ -2,8 +2,7 @@ //! `PlanWriter`). //! Apart from `original_verify_gpu_plan.rs`, which holds the plan types. -#[allow(unused_imports)] -use super::*; +use super::{Error, MAX_PCIE_FETCHES, OriginalVerifyGpuPlan, PlanLayout, ResidentExpertBankSpan, Result, TensorRole}; impl OriginalVerifyGpuPlan { pub fn new() -> Self { diff --git a/crates/cuda-driver/src/original_verify_gpu_plan/plan_phases.rs b/crates/cuda-driver/src/original_verify_gpu_plan/plan_phases.rs index f93a12b3..e350d482 100644 --- a/crates/cuda-driver/src/original_verify_gpu_plan/plan_phases.rs +++ b/crates/cuda-driver/src/original_verify_gpu_plan/plan_phases.rs @@ -1,8 +1,11 @@ //! STRA-338 size: the phases of `OriginalVerifyCpuSink::publish_gpu_plan`, extracted in call order. use super::cpu_sink_publish_gpu_plan::dma_options; -#[allow(unused_imports)] -use super::*; +use super::{ + Error, MAX_PCIE_FETCHES, OriginalExpertCache, OriginalGpuStream, OriginalVerifyGpuPlan, OriginalVerifyPcieSource, + PlanEntryShape, PlanLayout, Rc, ResidentExpertBankSpan, Result, encode_plan_block, schedule, span_layer, + staging_blobs_per_group, +}; type PcieSource<'a, 'ctx> = Option<&'a OriginalVerifyPcieSource<'a, 'ctx>>; diff --git a/crates/cuda-driver/src/original_verify_schedule.rs b/crates/cuda-driver/src/original_verify_schedule.rs index 4f27f3bf..8e1471b4 100644 --- a/crates/cuda-driver/src/original_verify_schedule.rs +++ b/crates/cuda-driver/src/original_verify_schedule.rs @@ -1,7 +1,14 @@ //! Verifier::run/capture/commit host scheduling. Real graph resources contain //! the full native layer producers; this controller never substitutes prompt //! GEMM arithmetic or per-token forward calls for a verification window. -use super::*; +use super::{ + Context, DeviceBuffer, Error, LogitRows, LogprobReadout, MappedAllocation, MappedRouteOperands, OriginalCapture, + OriginalVerifyBank, OriginalVerifyDiag, OriginalVerifyGeometry, OriginalVerifyGraphResources, + OriginalVerifyProfile, OriginalVerifyRearm, OriginalVerifyRow, OriginalVerifyWindow, Result, RouteRowSpan, combine, + diag, handle, logpos_topk_from_environment, poison, transport, window_plan, write_window_logprobs, zero, +}; +#[cfg(test)] +use super::{OriginalGraphResources, OriginalVerifyGdnJournal, profile_stamp_words}; use crate::OriginalNativeHeadGraphResources; use crate::{ NativeHeadSampling, NativeHeadSelection, OriginalCapturePolicy, OriginalEventKind, OriginalGpuEvent, diff --git a/crates/cuda-driver/src/original_verify_schedule/commit_sync_forced.rs b/crates/cuda-driver/src/original_verify_schedule/commit_sync_forced.rs index 9e9202c0..18adc063 100644 --- a/crates/cuda-driver/src/original_verify_schedule/commit_sync_forced.rs +++ b/crates/cuda-driver/src/original_verify_schedule/commit_sync_forced.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalVerifyCpuSink`: `with_output`. //! Methods of `OriginalVerifier`: `new`, `open`, `unopened`, `bank` and 9 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Error, OriginalCapture, OriginalCapturePolicy, OriginalEventKind, OriginalNativeHeadGraphResources, + OriginalStreamKind, OriginalVerifier, OriginalVerifyBank, OriginalVerifyCpuSink, OriginalVerifyGeometry, + OriginalVerifyGraphResources, OriginalVerifyProfile, Result, combine, diag, window_plan, +}; /// `STRATA_COMMIT_SYNC`, read once (it sat on the per-round commit path). pub(super) fn commit_sync_forced() -> bool { diff --git a/crates/cuda-driver/src/original_verify_schedule/original_verifier.rs b/crates/cuda-driver/src/original_verify_schedule/original_verifier.rs index 15a92fcc..7fc00a37 100644 --- a/crates/cuda-driver/src/original_verify_schedule/original_verifier.rs +++ b/crates/cuda-driver/src/original_verify_schedule/original_verifier.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalVerifier`: `run`, `commit`, `commit_after_stage`, `complete_commit_sync`. //! Split out of `schedule` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, NativeHeadSampling, OriginalGpuStream, OriginalNativeHeadGraphResources, OriginalVerifier, + OriginalVerifyCpuRows, OriginalVerifyCpuSink, OriginalVerifyGraphResources, OriginalVerifyWindowResult, + OriginalVerifyWindowTokens, Result, combine, commit_sync_forced, +}; impl<'ctx, R: OriginalVerifyGraphResources<'ctx> + OriginalNativeHeadGraphResources<'ctx>> OriginalVerifier<'ctx, R> { /// Cached real all-T graph; CPU/GPU split and mapped flag rings match Original. diff --git a/crates/cuda-driver/src/original_verify_schedule/verifier_commit_window_lifecycle.rs b/crates/cuda-driver/src/original_verify_schedule/verifier_commit_window_lifecycle.rs index b68c6536..21d63c85 100644 --- a/crates/cuda-driver/src/original_verify_schedule/verifier_commit_window_lifecycle.rs +++ b/crates/cuda-driver/src/original_verify_schedule/verifier_commit_window_lifecycle.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalVerifier`: `pending_commit_event`, `wait_commit`, `complete_pending_commit`, `discard_window`... //! Split out of `schedule` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + DeviceBuffer, Duration, Error, Instant, OriginalGpuEvent, OriginalNativeHeadGraphResources, OriginalVerifier, + OriginalVerifyBank, OriginalVerifyDiag, OriginalVerifyGraphResources, OriginalVerifyRow, OriginalVerifyWindow, + Result, Write, combine, diag, +}; impl<'ctx, R: OriginalVerifyGraphResources<'ctx> + OriginalNativeHeadGraphResources<'ctx>> OriginalVerifier<'ctx, R> { /// The pending asynchronous commit's completion event (generate.cpp: what the next work on the commit's stream diff --git a/crates/cuda-driver/src/original_verify_schedule/verifier_logits_diagnostics_close.rs b/crates/cuda-driver/src/original_verify_schedule/verifier_logits_diagnostics_close.rs index 4c58834b..f443dc7d 100644 --- a/crates/cuda-driver/src/original_verify_schedule/verifier_logits_diagnostics_close.rs +++ b/crates/cuda-driver/src/original_verify_schedule/verifier_logits_diagnostics_close.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalVerifier`: `read_logit_rows`, `copy_logits`, `window_logprobs`, `window_logprobs_topk` and 7 ... //! Implements `Drop for OriginalVerifier`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Duration, Error, Instant, LogitRows, LogprobReadout, OriginalGpuStream, + OriginalNativeHeadGraphResources, OriginalVerifier, OriginalVerifyBank, OriginalVerifyGraphResources, Result, + Write, combine, handle, logpos_topk_from_environment, poison, transport, write_window_logprobs, zero, +}; /// The device range `[offset, offset + bytes)` of the bank's arena. fn arena_span(bank: &OriginalVerifyBank<'_>, offset: usize, bytes: usize) -> Result { diff --git a/crates/cuda-driver/src/original_verify_schedule/verifier_park_rearm.rs b/crates/cuda-driver/src/original_verify_schedule/verifier_park_rearm.rs index 3e4b90c1..633d517e 100644 --- a/crates/cuda-driver/src/original_verify_schedule/verifier_park_rearm.rs +++ b/crates/cuda-driver/src/original_verify_schedule/verifier_park_rearm.rs @@ -7,8 +7,12 @@ //! history with the next request's priors. Any error leaves the verifier failed, so the caller retires the set and //! records a new one; a partial re-arm is safe for that reason. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, OriginalNativeHeadGraphResources, OriginalVerifier, OriginalVerifyGraphResources, OriginalVerifyProfile, + OriginalVerifyRearm, Result, diag, +}; +#[cfg(test)] +use super::{Context, OriginalGraphResources, OriginalVerifyGdnJournal, profile_stamp_words}; impl<'ctx, R: OriginalVerifyGraphResources<'ctx> + OriginalNativeHeadGraphResources<'ctx>> OriginalVerifier<'ctx, R> { /// End of a request: wait a pending commit, drain both streams and retire every graph's launch. The recorded diff --git a/crates/cuda-driver/src/original_verify_schedule/window_phases.rs b/crates/cuda-driver/src/original_verify_schedule/window_phases.rs index 59e5b758..ee3297b9 100644 --- a/crates/cuda-driver/src/original_verify_schedule/window_phases.rs +++ b/crates/cuda-driver/src/original_verify_schedule/window_phases.rs @@ -1,7 +1,11 @@ //! STRA-338 size: the phases of `OriginalVerifier::run`, extracted in call order. -#[allow(unused_imports)] -use super::*; +use super::{ + Duration, Error, Instant, MappedAllocation, MappedRouteOperands, NativeHeadSampling, NativeHeadSelection, + OriginalGpuStream, OriginalNativeHeadGraphResources, OriginalVerifier, OriginalVerifyCpuRows, + OriginalVerifyCpuSink, OriginalVerifyGraphResources, OriginalVerifyWindowResult, Result, RouteRowSpan, combine, + diag, window_plan, +}; impl<'ctx, R: OriginalVerifyGraphResources<'ctx> + OriginalNativeHeadGraphResources<'ctx>> OriginalVerifier<'ctx, R> { /// Refuses a released or busy verifier, a mismatched position or row count and a PLE mismatch. diff --git a/crates/cuda-driver/src/original_verify_window_gr/assets.rs b/crates/cuda-driver/src/original_verify_window_gr/assets.rs index d4a1fb68..06205ba2 100644 --- a/crates/cuda-driver/src/original_verify_window_gr/assets.rs +++ b/crates/cuda-driver/src/original_verify_window_gr/assets.rs @@ -1,8 +1,13 @@ //! Methods of `GrVariant`: `from_env_value`. Methods of `GrConfig`: `from_device`, `query`, `down_entry`. //! Functions: `assets`, `cap_to_optin`, `shared_attributes`, `tiled_down_geometry` and 6 more. -#[allow(unused_imports)] -use super::*; +use super::{ + ARGS_WORDS, ATTR_COMPUTE_CAPABILITY_MAJOR, ATTR_COMPUTE_CAPABILITY_MINOR, ATTR_MAX_SHARED_PER_BLOCK, + ATTR_MAX_SHARED_PER_BLOCK_OPTIN, ArenaMap, AssetSpec, D, DOWN_BLOCKS, E_DOWN1280, E_DOWN2560, E_STAGED, EPS, Error, + GR_FUSED, GR_NORM, GR_POST, GrConfig, GrDeviceAttributes, GrVariant, HC, HcAddrs, HcReadPlan, LR, Launch, MAX_T, + MULTI_WORDS, N, NativeHeadDispatch, OriginalVerifyGdnJournal, OriginalVerifyGeometry, PLE_BATCH, PleConfig, Result, + RowArgs, Rows, STAGED_TILE, T_WORD, XN_WORD, proj, +}; /// Every module this family may launch from (the lead preloads them BEFORE capture). pub(crate) fn assets() -> Vec<&'static AssetSpec> { diff --git a/crates/cuda-driver/src/original_verify_window_gr/fused_down.rs b/crates/cuda-driver/src/original_verify_window_gr/fused_down.rs index dfda320d..ec2192b5 100644 --- a/crates/cuda-driver/src/original_verify_window_gr/fused_down.rs +++ b/crates/cuda-driver/src/original_verify_window_gr/fused_down.rs @@ -17,8 +17,11 @@ use super::super::chain; use super::super::sm120::Sm120Switches; use super::plan_hc_read::{hc_read_rows, hc_read_up}; -#[allow(unused_imports)] -use super::*; +use super::{ + A, ATTR_COMPUTE_CAPABILITY_MAJOR, ATTR_COMPUTE_CAPABILITY_MINOR, AssetSpec, D, DOWN_BLOCKS, GrConfig, GrVariant, + GrWindow, HcAddrs, HcHalf, Launch, LaunchExtent, OriginalVerifyGdnJournal, Result, Rows, THREADS, check_rows, + multi_words, plan_hc_read, +}; pub(crate) const E_GR_DOWN_FUSED: &str = "leleka_gr_down_fused_t2w8"; diff --git a/crates/cuda-driver/src/original_verify_window_gr/head_chain.rs b/crates/cuda-driver/src/original_verify_window_gr/head_chain.rs index b4345125..98520b93 100644 --- a/crates/cuda-driver/src/original_verify_window_gr/head_chain.rs +++ b/crates/cuda-driver/src/original_verify_window_gr/head_chain.rs @@ -19,8 +19,11 @@ //! The switch is resolved before capture (`resolve`, like `fused_down`) and carried in `GrConfig::head_chain_batch`; //! the asset is sm_120 only (`Sm120Switches`: a card below 12.x never takes it) and loaded only when it is on. use super::super::sm120::Sm120Switches; -#[allow(unused_imports)] -use super::*; +use super::{ + A, ATTR_COMPUTE_CAPABILITY_MAJOR, ATTR_COMPUTE_CAPABILITY_MINOR, ArenaMap, AssetSpec, Bf16GemvExtents, D, EPS, + GR_POST, GrConfig, HC, HeadAddrs, LR, Launch, LaunchExtent, N, OriginalVerifyGdnJournal, OriginalVerifyGeometry, + QUARTER, Result, Rows, StridedRows, THREADS, plan_bf16_gemv, +}; pub(crate) const E_FINAL_WRITE_ROWS: &str = "leleka_verify_final_write_rows"; pub(crate) const E_HEAD_NORM_ROWS: &str = "leleka_verify_head_norm_rows"; diff --git a/crates/cuda-driver/src/original_verify_window_gr/plan_hc_read.rs b/crates/cuda-driver/src/original_verify_window_gr/plan_hc_read.rs index a45a5a2d..93c88527 100644 --- a/crates/cuda-driver/src/original_verify_window_gr/plan_hc_read.rs +++ b/crates/cuda-driver/src/original_verify_window_gr/plan_hc_read.rs @@ -1,8 +1,12 @@ //! Functions: `plan_hc_read`, `hc_read_of_rows`, `hc_read_rows`, `hc_read_norm` and 9 more. //! Split out of `gr` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, ArenaMap, Bf16GemvExtents, D, DOWN_BLOCKS, E_NORM, E_SPLIT, E_UP, EPS, Error, GR_FUSED, GR_NORM, GR_POST, + GrConfig, GrVariant, GrWindow, HC, HcAddrs, HcHalf, HcReadPlan, HeadAddrs, LR, Launch, LaunchExtent, N, + OriginalVerifyGeometry, QUARTER, Result, RowArgs, Rows, STAGED_TILE, StridedRows, THREADS, UP_BLOCKS, + check_geometry, check_rows, chunk_words, multi_words, plan_bf16_gemv, refuse, row_span, tiled_down_geometry, +}; /// `gr_read_group(half, apply, inj_prev, inj_out)` of `pre(l, group)` for the window rows /// `[tb, te)`: `fused_gr_read_multi(fa, n, xn_ + tb * HC * N, ...)`. diff --git a/crates/cuda-driver/src/original_verify_window_gr/plan_head_mix_multi.rs b/crates/cuda-driver/src/original_verify_window_gr/plan_head_mix_multi.rs index e64048f2..badac0ca 100644 --- a/crates/cuda-driver/src/original_verify_window_gr/plan_head_mix_multi.rs +++ b/crates/cuda-driver/src/original_verify_window_gr/plan_head_mix_multi.rs @@ -12,8 +12,9 @@ //! argmax) is unchanged. use super::plan_hc_read::hc_read_of_rows; -#[allow(unused_imports)] -use super::*; +use super::{ + ArenaMap, D, Error, GrWindow, HC, HcAddrs, HeadAddrs, LR, Launch, N, Result, RowArgs, check_geometry, refuse, +}; /// The per-row addresses of head row `t`: no pending write (`bo_prev`, `inj_prev`), no inject output. fn head_row(arena: &(impl ArenaMap + ?Sized), mixed_out_base: u64, t: usize) -> Result { diff --git a/crates/cuda-driver/src/original_verify_window_gr/plan_ple_row.rs b/crates/cuda-driver/src/original_verify_window_gr/plan_ple_row.rs index ca3c40ac..08a7707e 100644 --- a/crates/cuda-driver/src/original_verify_window_gr/plan_ple_row.rs +++ b/crates/cuda-driver/src/original_verify_window_gr/plan_ple_row.rs @@ -1,8 +1,16 @@ //! Methods of `PleScratch`: `at`. //! Methods of `OriginalVerifyGrBinding`: `new`, `half`, `half_addrs`, `head_addrs` and 4 more. -#[allow(unused_imports)] -use super::*; +use super::{ + A, ArenaMap, Bf16GemvExtents, Context, D, DeviceBuffer, Error, GrWindow, HC, HC_DOWN_BYTES, HC_INJECT_BYTES, + HC_NORM_BYTES, HC_UP_BYTES, HcAddrs, HcHalf, HcHalfBuffers, HcLayerBuffers, HcOutputBuffers, HeadAddrs, LAYERS, + Launch, LaunchExtent, MmvqExtents, N, NativeWeight, OriginalVerifyGeometry, OriginalVerifyGrBinding, PLE_BATCH, + PLE_CONV_BYTES, PLE_HISTORY_BYTES, PLE_KEY_BF16_BYTES, PLE_NORM_BYTES, PLE_SCRATCH_BYTES, PLE_VALUE_BYTES, + PleAddrs, PleBuffers, PleConfig, PleKey, PleKeyBuffer, Result, Rows, SCRATCH_CONV, SCRATCH_GATE, SCRATCH_GATED, + SCRATCH_KEY, SCRATCH_NORM, SCRATCH_QUERY, SCRATCH_VALUE, StridedRows, THREADS, admit, check_geometry, check_rows, + handle, native_head_row_bytes, plan_bf16_gemv, plan_mmvq, plan_quantize_q8_1, q8_1_row_bytes, refuse, row_span, + write_row, +}; // ------------------------------------------------------------------------------------------------ // ple_layer1 diff --git a/crates/cuda-driver/src/original_verify_window_gr/tests/fused_down_launches.rs b/crates/cuda-driver/src/original_verify_window_gr/tests/fused_down_launches.rs index 9db187c1..e6c3a2ff 100644 --- a/crates/cuda-driver/src/original_verify_window_gr/tests/fused_down_launches.rs +++ b/crates/cuda-driver/src/original_verify_window_gr/tests/fused_down_launches.rs @@ -6,8 +6,10 @@ use super::super::fused_down::{ E_GR_DOWN_FUSED, FUSED_DOWN_MAX_SHARED, FusedDownDecision, GR_DOWN_FUSED, decide, fused_down_geometry, plan_hc_read_launches, shared_attributes, }; -#[allow(unused_imports)] -use super::*; +use super::{ + GrConfig, GrVariant, HcHalf, Launch, Rows, arena, entry_declared, from_card, rows, sm120, test_geometry, + tiled_down_geometry, weights, window, words, +}; const E_SPLIT_CHAIN: &str = "chain_gr_split"; const E_DOWN_TILED: &str = "chain_gr_down_t2w8_nb4"; diff --git a/crates/cuda-driver/src/original_verify_window_gr/tests/head_chain_launches.rs b/crates/cuda-driver/src/original_verify_window_gr/tests/head_chain_launches.rs index 5874d1e0..ec2ed5cd 100644 --- a/crates/cuda-driver/src/original_verify_window_gr/tests/head_chain_launches.rs +++ b/crates/cuda-driver/src/original_verify_window_gr/tests/head_chain_launches.rs @@ -5,8 +5,10 @@ use super::super::super::sm120::{DEFAULT_ON_HEAD_CHAIN_BATCH, Sm120Switches}; use super::head_chain::{ E_FINAL_WRITE_ROWS, E_HEAD_NORM_ROWS, E_HEAD_PRE_FINAL_ROWS, HEAD_CHAIN, assets as head_chain_assets, }; -#[allow(unused_imports)] -use super::*; +use super::{ + A, AssetSpec, GR_NORM, GR_POST, GrConfig, GrVariant, HeadAddrs, Launch, Rows, arena, entry_declared, from_card, + plan_final_write, plan_head_mix, rows, sm120, test_geometry, window, +}; const MIXED_BASE: u64 = 0x9999_0000; const HEAD: HeadAddrs = HeadAddrs { norm: 0xA000, down: 0xB000, up: 0xC000 }; diff --git a/crates/cuda-driver/src/original_verify_window_gr/tests/head_mix_is_the_native.rs b/crates/cuda-driver/src/original_verify_window_gr/tests/head_mix_is_the_native.rs index 17f8891c..32483e89 100644 --- a/crates/cuda-driver/src/original_verify_window_gr/tests/head_mix_is_the_native.rs +++ b/crates/cuda-driver/src/original_verify_window_gr/tests/head_mix_is_the_native.rs @@ -3,8 +3,12 @@ //! ple_row_with_a_bf16_key_follows_ple_block_native_order, //! ple_row_with_a_native_key_quantizes_into_the_arena_and_runs_mmvq .... -#[allow(unused_imports)] -use super::*; +use super::{ + A, Error, GrVariant, HC_DOWN_BYTES, HC_INJECT_BYTES, HC_NORM_BYTES, HC_UP_BYTES, HeadAddrs, Launch, LayoutMap, + PLE_BATCH, PLE_CONV_BYTES, PLE_HISTORY_BYTES, PLE_KEY_BF16_BYTES, PLE_SCRATCH_BYTES, PLE_VALUE_BYTES, PleConfig, + PleKey, SCRATCH_CONV, SCRATCH_GATE, SCRATCH_GATED, SCRATCH_NORM, SCRATCH_QUERY, SCRATCH_VALUE, arena, at, + native_head_row_bytes, plan_head_mix, plan_ple_layer1, plan_ple_row, ple_addrs, rows, sm120, test_geometry, window, +}; // ------------------------------------------------------------------------------------ head /// The five launches of head row `t`, against the native unfused gr read. diff --git a/crates/cuda-driver/src/original_verify_window_gr/tests/head_mix_multi.rs b/crates/cuda-driver/src/original_verify_window_gr/tests/head_mix_multi.rs index e2ddfefb..062b2de9 100644 --- a/crates/cuda-driver/src/original_verify_window_gr/tests/head_mix_multi.rs +++ b/crates/cuda-driver/src/original_verify_window_gr/tests/head_mix_multi.rs @@ -1,8 +1,10 @@ //! `plan_head_mix_multi` (`LELEKA_SM120_HEAD_MIX_MULTI`): the final mixer of the window as one multi-token hc read over //! the head weights, with the addresses the per-token path used. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, GrVariant, HcAddrs, HcHalf, HeadAddrs, Launch, Rows, arena, at, plan_hc_read, plan_head_mix, + plan_head_mix_multi, rows, sm120, test_geometry, window, words, +}; const MIXED_BASE: u64 = 0x9999_0000; const HEAD: HeadAddrs = HeadAddrs { norm: 0xA000, down: 0xB000, up: 0xC000 }; diff --git a/crates/cuda-driver/src/original_verify_window_gr/tests/tiled_down_projection_covers.rs b/crates/cuda-driver/src/original_verify_window_gr/tests/tiled_down_projection_covers.rs index fc0d71f7..0509c6c0 100644 --- a/crates/cuda-driver/src/original_verify_window_gr/tests/tiled_down_projection_covers.rs +++ b/crates/cuda-driver/src/original_verify_window_gr/tests/tiled_down_projection_covers.rs @@ -3,8 +3,11 @@ //! assets_are_pinned_and_export_every_named_entry, struct_layout_constants_match_fused_gr_args, //! down_chunk_on_big_cards_runs_the_2560_tile_with_all_eight_tokens .... -#[allow(unused_imports)] -use super::*; +use super::{ + A, ARGS_WORDS, E_DOWN1280, E_DOWN2560, E_NORM, E_SPLIT, E_STAGED, E_UP, Error, GR_FUSED, GR_POST, GrVariant, + HcHalf, HcReadPlan, Launch, LayoutMap, MULTI_WORDS, T_WORD, XN_WORD, arena, assets, at, entry_declared, from_card, + plan_final_write, plan_hc_read, rows, shared_attributes, sm120, test_geometry, weights, window, words, +}; #[test] fn the_tiled_down_projection_covers_every_row_and_token_with_four_two_token_tile_buffers() { diff --git a/crates/cuda-driver/src/original_verify_window_moe/pcie_fast_kernel.rs b/crates/cuda-driver/src/original_verify_window_moe/pcie_fast_kernel.rs index 5622cf75..92dc69cf 100644 --- a/crates/cuda-driver/src/original_verify_window_moe/pcie_fast_kernel.rs +++ b/crates/cuda-driver/src/original_verify_window_moe/pcie_fast_kernel.rs @@ -1,8 +1,12 @@ //! Methods of `MoeKnobs`: `mode17`. Methods of `ExpertBlob`: `words`. //! Functions: `pcie_fast_kernel`, `pcie_kernel_name`, `pcie_grid`, `assets` and 13 more. -#[allow(unused_imports)] -use super::*; +use super::{ + ArenaMap, AssetSpec, COMBINE, Context, DeviceBuffer, ELEMENT, EXPERTS, Error, ExpertBlob, HEAD_IQ_EXPERT, MoeKnobs, + MoeLayerAddrs, NativeHeadDispatch, NativeWeight, OriginalVerifyExpertFormats, OriginalVerifyGeometry, + OriginalVerifyMoeBinding, OriginalVerifyMoeLayerWeights, PCIE, PCIE_FAST, PlanLayout, ROUTER, ROUTER_LEGACY, + Result, Rows, S2_HITS, SHARED, WINDOW_LAYERS, admit, handle, native_head_row_bytes, proj, +}; /// `LELEKA_PCIE_KERNEL` = `k1u4|k1u8|k1u16|k2u4|k2u8|k2u16` selects an alternative staging copy kernel of the /// copy-kernel PCIe mode (default: the sealed `verify_fetch_spans_kernel`); `LELEKA_PCIE_GRID=BLOCKSxTHREADS` its diff --git a/crates/cuda-driver/src/original_verify_window_moe/plan_expert_groups.rs b/crates/cuda-driver/src/original_verify_window_moe/plan_expert_groups.rs index 63fbe137..6170e2a7 100644 --- a/crates/cuda-driver/src/original_verify_window_moe/plan_expert_groups.rs +++ b/crates/cuda-driver/src/original_verify_window_moe/plan_expert_groups.rs @@ -2,8 +2,12 @@ //! Functions: `plan_expert_groups`, `group_kernels`, `fused_gate_up_entry`, `plan_hit_add` and 5 more. use super::super::down; -#[allow(unused_imports)] -use super::*; +use super::{ + A, ArenaMap, COMBINE, DOWN_ENTRIES, E_ADD_HITS, E_COMBINE, E_MOE_COMBINE, E_QUANTIZE_Q8_1, E_SWIGLU_ENTRIES, + EXPERTS, Error, ExpertBlob, ExpertTier, GU_ENTRIES, HEAD_IQ_EXPERT, Launch, LaunchExtent, MoeKnobs, + OriginalVerifyExpertFormats, OriginalVerifyGeometry, PlanLayout, Result, Rows, S2_HITS, SHARED, check_rows, + expert_scratch, f32s, plan_word, proj, +}; /// The row arena the planners read, as a trait object (one place names the dyn). type Arena<'a> = &'a dyn ArenaMap; diff --git a/crates/cuda-driver/src/original_verify_window_moe/plan_f32_to_bf16.rs b/crates/cuda-driver/src/original_verify_window_moe/plan_f32_to_bf16.rs index 7183e32c..d5f2a149 100644 --- a/crates/cuda-driver/src/original_verify_window_moe/plan_f32_to_bf16.rs +++ b/crates/cuda-driver/src/original_verify_window_moe/plan_f32_to_bf16.rs @@ -1,8 +1,12 @@ //! Methods of `BatchedRows`: `new`. Methods of `RouterSpans`: `mixed`, `logits`, `ids`, `weights`. //! Functions: `plan_f32_to_bf16`, `plan_route`, `plan_router`, `router_batched` and 5 more. -#[allow(unused_imports)] -use super::*; +use super::{ + A, ArenaMap, Bf16GemvExtents, E_NATIVE_SWIGLU, E_QUANTIZE_Q8_1, E_ROUTE, E_ROUTER_TOP10, E_SCALAR_GATE, + E_SCALE_ROWS, E_SIGMOID, E_SIGMOID_MULTI, E_TO_BF16, ELEMENT, Error, HEAD_IQ_EXPERT, Launch, LaunchExtent, + MmvqExtents, MoeKnobs, MoeLayerAddrs, OriginalVerifyGeometry, ROUTER, ROUTER_LEGACY, Result, Rows, SHARED, + StridedRows, align256, check_rows, f32s, items, plan_bf16_gemv, plan_mmvq, plan_quantize_q8_1, proj, +}; /// `f32_to_bf16_bulk(x, y, count)`: `to_bf16_kernel<<>>(x, y, count)`. pub(super) fn plan_f32_to_bf16(x: u64, y: u64, count: usize) -> Result { diff --git a/crates/cuda-driver/src/original_verify_window_moe/tests/alternative_pcie_staging_copy.rs b/crates/cuda-driver/src/original_verify_window_moe/tests/alternative_pcie_staging_copy.rs index 15bc8868..f0eb7a80 100644 --- a/crates/cuda-driver/src/original_verify_window_moe/tests/alternative_pcie_staging_copy.rs +++ b/crates/cuda-driver/src/original_verify_window_moe/tests/alternative_pcie_staging_copy.rs @@ -3,8 +3,11 @@ //! expert_asset_is_sealed_and_a_corrupted_copy_still_refuses_to_load, //! expert_entries_match_the_cu_source_and_the_original_format_lists .... -#[allow(unused_imports)] -use super::*; +use super::{ + A, BatchedRows, COMBINE, DOWN_ENTRIES, ELEMENT, EXPERTS, Error, GU_ENTRIES, HEAD_IQ_EXPERT, Launch, LayoutMap, + MoeKnobs, PCIE_FAST, ROUTER, ROUTER_LEGACY, S2_HITS, SHARED, assert_abi, assets, at, d_qk, entries, entry_declared, + gu_qk, map, plan_router, plan_shared_expert, proj, rows, shared_attributes, test_geometry, weights, +}; #[test] fn the_alternative_pcie_staging_copy_kernels_are_sealed() { diff --git a/crates/cuda-driver/src/original_verify_window_moe/tests/down_sub16_plan.rs b/crates/cuda-driver/src/original_verify_window_moe/tests/down_sub16_plan.rs index 0b1a8071..9d61cef7 100644 --- a/crates/cuda-driver/src/original_verify_window_moe/tests/down_sub16_plan.rs +++ b/crates/cuda-driver/src/original_verify_window_moe/tests/down_sub16_plan.rs @@ -2,8 +2,10 @@ //! projection of IQ4_NL / Q2_0 layers is `sm120_moe_down_` (group-strided rows) and the PCIe pass launches //! `PCIE_GROUP_ROWS` block rows of the kernels that stride. -#[allow(unused_imports)] -use super::*; +use super::{ + A, EXPERTS, ExpertGroupSite, ExpertTier, Launch, MoeKnobs, OriginalVerifyExpertFormats, Rows, WINDOW_LAYERS, + assert_abi, entries, map, plan_expert_groups, rows, test_geometry, +}; use crate::original_verify::down; fn site(layer: usize, rows: Rows, tier: ExpertTier, down_sub16: bool) -> ExpertGroupSite { diff --git a/crates/cuda-driver/src/original_verify_window_moe/tests/hit_add_scans_the_cpu.rs b/crates/cuda-driver/src/original_verify_window_moe/tests/hit_add_scans_the_cpu.rs index ef0b7fd5..9c17e917 100644 --- a/crates/cuda-driver/src/original_verify_window_moe/tests/hit_add_scans_the_cpu.rs +++ b/crates/cuda-driver/src/original_verify_window_moe/tests/hit_add_scans_the_cpu.rs @@ -3,8 +3,10 @@ //! per_row_combine_is_native_combine_per_token_or_the_legacy_kernel, //! plan_word_stays_inside_the_plan_span_and_the_two_groups. -#[allow(unused_imports)] -use super::*; +use super::{ + A, Error, LayoutMap, MoeKnobs, OriginalVerifyGeometry, assert_abi, at, map, plan_combine, plan_hit_add, plan_word, + rows, test_geometry, +}; // ---- hit add, combine ---------------------------------------------------------------------- diff --git a/crates/cuda-driver/src/original_verify_window_moe/tests/shared_gate_without_native_bf16.rs b/crates/cuda-driver/src/original_verify_window_moe/tests/shared_gate_without_native_bf16.rs index 5049d2a0..1c68c9f8 100644 --- a/crates/cuda-driver/src/original_verify_window_moe/tests/shared_gate_without_native_bf16.rs +++ b/crates/cuda-driver/src/original_verify_window_moe/tests/shared_gate_without_native_bf16.rs @@ -2,8 +2,12 @@ //! shared_gate_without_native_bf16_extra_reads_the_bf16_activation, shared_expert_covers_every_window_size, //! expert_input_is_the_q8_1_row_quantizer_into_nat_xq, expert_blob_layout_matches_native_expert_layout .... -#[allow(unused_imports)] -use super::*; +use super::{ + A, BatchedRows, EXPERTS, Error, ExpertGroupSite, ExpertTier, Launch, LaunchExtent, LayoutMap, MoeKnobs, + OriginalVerifyExpertFormats, OriginalVerifyGeometry, Rows, WINDOW_LAYERS, assert_abi, at, entries, expert_blob, + expert_scratch, formats, map, plan_expert_groups, plan_quantize_expert_input, plan_shared_expert, rows, + test_geometry, weights, +}; /// The VRAM tier's group of `rows` in `layer`. fn vram_site(layer: usize, rows: Rows) -> ExpertGroupSite { diff --git a/crates/cuda-driver/src/original_verify_window_ops.rs b/crates/cuda-driver/src/original_verify_window_ops.rs index ec23bb40..7b520c77 100644 --- a/crates/cuda-driver/src/original_verify_window_ops.rs +++ b/crates/cuda-driver/src/original_verify_window_ops.rs @@ -32,7 +32,11 @@ use super::sm120; use super::window_plan::{PlanLayout, WINDOW_LAYERS, staging_blobs_per_group}; use super::window_plan::{gdn_index, qsa_layer}; use super::window_record::{ExpertTier, HcHalf, Projection, QuantSource, Rows, WindowOps, WindowPolicy, record_window}; -use super::*; +use super::{ + Arg, Command, Context, Error, OriginalCapture, OriginalGraphResources, OriginalVerifier, OriginalVerifyGdnJournal, + OriginalVerifyGdnStage, OriginalVerifyGeometry, OriginalVerifyGraphResources, OriginalVerifyResources, Result, + combine_head, command, down, ffn, gdn_fused, handle, resources, +}; use crate::{OriginalNativeEmbedRows, OriginalNativeHeadGraphResources}; /// Producers with no genuine capturable owner in this tree: none. Every `WindowOps` call is bound; what is diff --git a/crates/cuda-driver/src/original_verify_window_ops/all_window_assets.rs b/crates/cuda-driver/src/original_verify_window_ops/all_window_assets.rs index 958cc9eb..7d9be575 100644 --- a/crates/cuda-driver/src/original_verify_window_ops/all_window_assets.rs +++ b/crates/cuda-driver/src/original_verify_window_ops/all_window_assets.rs @@ -1,8 +1,14 @@ //! Methods of `OriginalVerifyExpertLayout`: `new`, `with_role_bytes`, `blob_bytes`, `role_bytes`. //! Methods of `OriginalVerifyWindowResources`: `new`, `rows`, `with_projections`, `with_gr` and 4 more. -#[allow(unused_imports)] -use super::*; +use super::{ + AssetSpec, Context, Error, GdnProjectionAddrs, GrConfig, HcHalf, MoeLayerAddrs, OriginalGraphResources, + OriginalNativeEmbedRows, OriginalNativeHeadGraphResources, OriginalVerifyExpertFormats, OriginalVerifyExpertLayout, + OriginalVerifyGdnJournal, OriginalVerifyGrBinding, OriginalVerifyGraphResources, OriginalVerifyMoeBinding, + OriginalVerifyProjBinding, OriginalVerifyQsaBinding, OriginalVerifyQsaKvBinding, OriginalVerifyResources, + OriginalVerifyWindowResources, Planner, QsaLayerAddrs, QsaProjectionAddrs, QsaRope, Result, WINDOW_LAYERS, + WindowPolicy, WindowWeights, chain, down, gr, hits_combine, moe, proj, qsa, resources, sm120, wait_rows, +}; /// Every kernel asset a window can launch from (all families), regardless of what is attached. pub(in super::super) fn all_window_assets() -> Vec<&'static AssetSpec> { diff --git a/crates/cuda-driver/src/original_verify_window_ops/gdn_stages.rs b/crates/cuda-driver/src/original_verify_window_ops/gdn_stages.rs index 4a92b51d..4ca8a468 100644 --- a/crates/cuda-driver/src/original_verify_window_ops/gdn_stages.rs +++ b/crates/cuda-driver/src/original_verify_window_ops/gdn_stages.rs @@ -3,8 +3,7 @@ //! Original's kernel as before. use super::gdn_fused::{GdnStages, GdnStep}; -#[allow(unused_imports)] -use super::*; +use super::{OriginalVerifyGdnStage, OriginalVerifyWindowOps, Result, Rows}; impl OriginalVerifyWindowOps<'_, '_, '_> { fn gdn_stages(&self) -> GdnStages { diff --git a/crates/cuda-driver/src/original_verify_window_ops/hits_combine.rs b/crates/cuda-driver/src/original_verify_window_ops/hits_combine.rs index 6d294081..6a73d72a 100644 --- a/crates/cuda-driver/src/original_verify_window_ops/hits_combine.rs +++ b/crates/cuda-driver/src/original_verify_window_ops/hits_combine.rs @@ -12,8 +12,9 @@ #[path = "hits_combine/plan_hits_combine.rs"] mod plan_hits_combine; -#[allow(unused_imports)] -use super::*; +use super::{AssetSpec, Launch, OriginalVerifyWindowOps, Planner, Result, Rows, ffn}; +#[cfg(test)] +use super::{A, Error}; pub(crate) use plan_hits_combine::{E_COMBINE_HITS, HITS_COMBINE}; use plan_hits_combine::{HitsCombineSite, plan_hits_combine}; diff --git a/crates/cuda-driver/src/original_verify_window_ops/original_verifier.rs b/crates/cuda-driver/src/original_verify_window_ops/original_verifier.rs index c51d5282..f9fdc60c 100644 --- a/crates/cuda-driver/src/original_verify_window_ops/original_verifier.rs +++ b/crates/cuda-driver/src/original_verify_window_ops/original_verifier.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalVerifier`: `record_literal_window`, `record_all`. //! Functions: `resolve_cluster_topk`, `resolve_sm120_switches`, `pcie_role_bytes`, `graph_oom_at`. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, OriginalVerifier, OriginalVerifyGraphResources, OriginalVerifyWindowOps, OriginalVerifyWindowResources, + Result, WINDOW_LAYERS, WindowPolicy, combine_head, ffn, gdn_fused, gr, qsa, record_window, sm120, +}; impl<'ctx> OriginalVerifier<'ctx, OriginalVerifyWindowResources<'ctx>> { /// Record the T-token window graph for `t` (split windows use two groups). diff --git a/crates/cuda-driver/src/original_verify_window_ops/qsa_prelude_ops.rs b/crates/cuda-driver/src/original_verify_window_ops/qsa_prelude_ops.rs index 4d583153..ecb54e8f 100644 --- a/crates/cuda-driver/src/original_verify_window_ops/qsa_prelude_ops.rs +++ b/crates/cuda-driver/src/original_verify_window_ops/qsa_prelude_ops.rs @@ -6,8 +6,7 @@ //! inside the indexer chain on the side stream with `SIDE_QSA`), and the snapshot that precedes the first row in the //! literal order is its first step, so the order the side branches rely on is unchanged. -#[allow(unused_imports)] -use super::*; +use super::{OriginalVerifyWindowOps, Result, Rows, qsa}; use qsa::fused_prelude::IndexImage; impl<'ctx> OriginalVerifyWindowOps<'_, '_, 'ctx> { diff --git a/crates/cuda-driver/src/original_verify_window_ops/side_qsa_branches.rs b/crates/cuda-driver/src/original_verify_window_ops/side_qsa_branches.rs index 52b1ad71..eb29e9e1 100644 --- a/crates/cuda-driver/src/original_verify_window_ops/side_qsa_branches.rs +++ b/crates/cuda-driver/src/original_verify_window_ops/side_qsa_branches.rs @@ -9,8 +9,7 @@ //! before the decode attention. The launches are the literal ones and run in the same order inside each chain, so the //! outputs are bitwise those of the in-line order; only the graph's dependency edges change. -#[allow(unused_imports)] -use super::*; +use super::{OriginalVerifyWindowOps, Projection, Result, Rows, qsa_layer}; /// One sparse-attention layer of a window: its index among the QSA layers, the window rows and whether the rows run as /// one batched launch. diff --git a/crates/cuda-driver/src/original_verify_window_ops/side_shared_expert.rs b/crates/cuda-driver/src/original_verify_window_ops/side_shared_expert.rs index 6ea53239..dd669dd6 100644 --- a/crates/cuda-driver/src/original_verify_window_ops/side_shared_expert.rs +++ b/crates/cuda-driver/src/original_verify_window_ops/side_shared_expert.rs @@ -8,8 +8,7 @@ //! capture stream right after the doorbell and joins before the combine. The launches and their order are the //! literal ones: the outputs are bitwise those of the in-line order, only the graph's dependency edges change. -#[allow(unused_imports)] -use super::*; +use super::{OriginalVerifyWindowOps, Result, Rows}; impl<'ctx> OriginalVerifyWindowOps<'_, '_, 'ctx> { /// The shared expert runs on side stream 0 (not in a split window, as the other side branches). diff --git a/crates/cuda-driver/src/original_verify_window_ops/wait_rows.rs b/crates/cuda-driver/src/original_verify_window_ops/wait_rows.rs index 59267613..58467ef7 100644 --- a/crates/cuda-driver/src/original_verify_window_ops/wait_rows.rs +++ b/crates/cuda-driver/src/original_verify_window_ops/wait_rows.rs @@ -9,8 +9,7 @@ //! Only the rows kernel (`dec_batch`, always true in mode 17) is folded; the flat copy of a non-`dec_batch` policy //! refuses the recording by name instead of silently recording the unfolded pair under the name of the switch. use super::ffn::FfnSwitches; -#[allow(unused_imports)] -use super::*; +use super::{A, AssetSpec, Error, Launch, LaunchExtent, OriginalVerifyWindowOps, Result, Rows}; pub(crate) const E_WAIT_COPY_ROWS: &str = "leleka_verify_wait_copy_rows"; /// Index of flag M (the CPU leg's rows are in the mapped buffer) in the mapped flag bank. diff --git a/crates/cuda-driver/src/original_verify_window_ops/window_launches.rs b/crates/cuda-driver/src/original_verify_window_ops/window_launches.rs index 1191febb..2995fe05 100644 --- a/crates/cuda-driver/src/original_verify_window_ops/window_launches.rs +++ b/crates/cuda-driver/src/original_verify_window_ops/window_launches.rs @@ -2,8 +2,10 @@ //! offsets, the journal and submit. //! Apart from `window_ops_kernels_and_pcie_plan.rs`, which implements the `WindowOps` kernels. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Command, Error, Launch, OriginalVerifyGdnJournal, OriginalVerifyGeometry, OriginalVerifyWindowOps, PlanLayout, + Planner, Projection, Result, Rows, command, gdn_index, handle, +}; impl<'ctx> OriginalVerifyWindowOps<'_, '_, 'ctx> { /// SIDE_MIXER (upstream `STRATA_SIDE_MIXER=2`, GDN part): the GDN gates and the gate projection run on side diff --git a/crates/cuda-driver/src/original_verify_window_ops/window_ops_kernels_and_pcie_plan.rs b/crates/cuda-driver/src/original_verify_window_ops/window_ops_kernels_and_pcie_plan.rs index 8a4fe65b..97eca746 100644 --- a/crates/cuda-driver/src/original_verify_window_ops/window_ops_kernels_and_pcie_plan.rs +++ b/crates/cuda-driver/src/original_verify_window_ops/window_ops_kernels_and_pcie_plan.rs @@ -3,8 +3,11 @@ #[allow(unused_imports)] use super::side_qsa_branches::QsaSideLayer; -#[allow(unused_imports)] -use super::*; +use super::{ + A, Arg, Command, Error, ExpertTier, HcHalf, Launch, LaunchExtent, OriginalVerifyGraphResources, + OriginalVerifyWindowOps, Projection, QuantSource, Result, Rows, WindowOps, chain, command, handle, moe, + staging_blobs_per_group, +}; impl WindowOps for OriginalVerifyWindowOps<'_, '_, '_> { fn embed(&mut self) -> Result<()> { diff --git a/crates/cuda-driver/src/original_verify_window_planner/tests/combine_head_switches.rs b/crates/cuda-driver/src/original_verify_window_planner/tests/combine_head_switches.rs index 72e9d4e3..ed704cf8 100644 --- a/crates/cuda-driver/src/original_verify_window_planner/tests/combine_head_switches.rs +++ b/crates/cuda-driver/src/original_verify_window_planner/tests/combine_head_switches.rs @@ -2,8 +2,7 @@ //! literal one, each switch alone changes only its own launches, and the launch counts fall as the design note says. use super::super::super::combine_head::{CombineHeadKernels, E_COMBINE_VEC4}; -#[allow(unused_imports)] -use super::*; +use super::{PlanOps, Planner, WindowPolicy, geometry_and_fake, record, record_window, section, sm120, test_geometry}; const OFF: CombineHeadKernels = CombineHeadKernels { combine_vec4: false, head_mix_multi: false }; const VEC4: CombineHeadKernels = CombineHeadKernels { combine_vec4: true, head_mix_multi: false }; diff --git a/crates/cuda-driver/src/original_verify_window_planner/tests/every_window_size_and_group.rs b/crates/cuda-driver/src/original_verify_window_planner/tests/every_window_size_and_group.rs index 4fc7fd5b..f489e6ca 100644 --- a/crates/cuda-driver/src/original_verify_window_planner/tests/every_window_size_and_group.rs +++ b/crates/cuda-driver/src/original_verify_window_planner/tests/every_window_size_and_group.rs @@ -4,8 +4,9 @@ //! a_qsa_layer_records_the_kv_chain_between_the_projections, post_records_vram_then_pcie_experts_hit_add_and_combine //! .... -#[allow(unused_imports)] -use super::*; +use super::{ + PlanOps, Planner, WindowPolicy, geometry_and_fake, names, record, record_window, section, sm120, test_geometry, +}; #[test] fn every_window_size_and_group_split_plans_without_error() { diff --git a/crates/cuda-driver/src/original_verify_window_planner/tests/fused_gr_down.rs b/crates/cuda-driver/src/original_verify_window_planner/tests/fused_gr_down.rs index 79ddb765..90e180a2 100644 --- a/crates/cuda-driver/src/original_verify_window_planner/tests/fused_gr_down.rs +++ b/crates/cuda-driver/src/original_verify_window_planner/tests/fused_gr_down.rs @@ -2,8 +2,7 @@ //! every hc read become one launch; without it the switch changes nothing. use super::super::super::chain::{self, ChainFlags}; -#[allow(unused_imports)] -use super::*; +use super::{GrConfig, PlanOps, Planner, WindowPolicy, geometry_and_fake, record, record_window, sm120, test_geometry}; const SPLIT: &str = "chain_gr_split"; const DOWN: &str = "chain_gr_down_t2w8_nb4"; diff --git a/crates/cuda-driver/src/original_verify_window_planner/tests/fused_qsa_prelude.rs b/crates/cuda-driver/src/original_verify_window_planner/tests/fused_qsa_prelude.rs index 3fac403d..2a0f1704 100644 --- a/crates/cuda-driver/src/original_verify_window_planner/tests/fused_qsa_prelude.rs +++ b/crates/cuda-driver/src/original_verify_window_planner/tests/fused_qsa_prelude.rs @@ -3,8 +3,10 @@ use super::super::super::kernels::A; use super::super::super::window_plan::qsa_layer; -#[allow(unused_imports)] -use super::*; +use super::{ + ArenaMap, Fake, Launch, LayoutMap, PlanOps, Planner, Rows, WindowPolicy, fake_index_image, geometry_and_fake, + names, record, record_window, section, sm120, test_geometry, +}; fn policy_with(fused: bool) -> WindowPolicy { let mut policy = WindowPolicy::mode17(); diff --git a/crates/cuda-driver/src/original_verify_window_planner/tests/head_chain_batch.rs b/crates/cuda-driver/src/original_verify_window_planner/tests/head_chain_batch.rs index cf4c8dcf..94940659 100644 --- a/crates/cuda-driver/src/original_verify_window_planner/tests/head_chain_batch.rs +++ b/crates/cuda-driver/src/original_verify_window_planner/tests/head_chain_batch.rs @@ -4,8 +4,7 @@ use super::super::super::combine_head::CombineHeadKernels; use super::super::super::gr::head_chain::{E_FINAL_WRITE_ROWS, E_HEAD_NORM_ROWS, E_HEAD_PRE_FINAL_ROWS}; -#[allow(unused_imports)] -use super::*; +use super::{GrConfig, PlanOps, Planner, WindowPolicy, geometry_and_fake, record, record_window, sm120, test_geometry}; fn record_batched(cfg: GrConfig, t: usize, groups: usize, multi: bool) -> Vec { let (m, fake) = geometry_and_fake(false); diff --git a/crates/cuda-driver/src/original_verify_window_proj/admit_matrix.rs b/crates/cuda-driver/src/original_verify_window_proj/admit_matrix.rs index 0f282041..b3ee4320 100644 --- a/crates/cuda-driver/src/original_verify_window_proj/admit_matrix.rs +++ b/crates/cuda-driver/src/original_verify_window_proj/admit_matrix.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalVerifyProjBinding`: `new`, `gdn_addrs`, `qsa_addrs`, `assets`. Functions: `admit_matrix`. //! Split out of `proj` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + AssetSpec, Context, Error, GdnProjectionAddrs, HEAD_IQ, HEAD_NATIVE, NativeWeight, OriginalVerifyGdnProjections, + OriginalVerifyGeometry, OriginalVerifyNativeMatrix, OriginalVerifyProjBinding, OriginalVerifyQsaProjections, + QsaProjectionAddrs, Result, is_iq_kind, native_matrix_bytes, +}; pub(super) fn admit_matrix( context: &Context<'_>, diff --git a/crates/cuda-driver/src/original_verify_window_proj/head_iq_entries_types.rs b/crates/cuda-driver/src/original_verify_window_proj/head_iq_entries_types.rs index 98964655..8b78b3a3 100644 --- a/crates/cuda-driver/src/original_verify_window_proj/head_iq_entries_types.rs +++ b/crates/cuda-driver/src/original_verify_window_proj/head_iq_entries_types.rs @@ -1,8 +1,7 @@ //! Defines `NativeWeight`, `OriginalVerifyNativeMatrix`, `OriginalVerifyGdnProjections` and 4 more. //! HEAD_IQ_ENTRIES, BF16_ENTRIES, HEAD_NATIVE, HEAD_IQ, BF16, NativeWeight .... -#[allow(unused_imports)] -use super::*; +use super::{AssetSpec, DeviceRef, HEAD_NATIVE_ENTRIES}; pub(super) const HEAD_IQ_ENTRIES: &[&str] = &[ "head_i7_old", diff --git a/crates/cuda-driver/src/original_verify_window_proj/head_native_entries_types.rs b/crates/cuda-driver/src/original_verify_window_proj/head_native_entries_types.rs index 2f4278a9..99bd4c56 100644 --- a/crates/cuda-driver/src/original_verify_window_proj/head_native_entries_types.rs +++ b/crates/cuda-driver/src/original_verify_window_proj/head_native_entries_types.rs @@ -1,9 +1,6 @@ //! Items of the parent module. //! HEAD_NATIVE_ENTRIES. -#[allow(unused_imports)] -use super::*; - pub(super) const HEAD_NATIVE_ENTRIES: &[&str] = &[ "head_quant", "head_n2_s0", diff --git a/crates/cuda-driver/src/original_verify_window_proj/q8_1_row_bytes.rs b/crates/cuda-driver/src/original_verify_window_proj/q8_1_row_bytes.rs index 0cf4511c..54f53021 100644 --- a/crates/cuda-driver/src/original_verify_window_proj/q8_1_row_bytes.rs +++ b/crates/cuda-driver/src/original_verify_window_proj/q8_1_row_bytes.rs @@ -1,8 +1,11 @@ //! Methods of `StridedRows`: `new`. Methods of `Bf16GemvExtents`: `new`. //! Functions: `q8_1_row_bytes`, `is_iq_kind`, `mmvq_assets`, `mmvq_asset` and 17 more. -#[allow(unused_imports)] -use super::*; +use super::{ + A, ArenaMap, AssetSpec, BF16, BF16_ENTRIES, Error, GdnProjectionAddrs, HEAD_IQ, HEAD_NATIVE, Launch, LaunchExtent, + NativeHeadDispatch, NativeWeight, OriginalVerifyGeometry, Projection, QsaProjectionAddrs, QuantSource, Result, + Rows, gdn_index, head_dispatch, native_head_row_bytes, qsa_index, +}; /// Bytes of one q8_1-quantized activation row of `n_in` elements (`n_in/32` blocks of 36). pub(crate) const fn q8_1_row_bytes(n_in: usize) -> usize { diff --git a/crates/cuda-driver/src/original_verify_window_qsa/assets.rs b/crates/cuda-driver/src/original_verify_window_qsa/assets.rs index 8f3eb5c3..82c85dd3 100644 --- a/crates/cuda-driver/src/original_verify_window_qsa/assets.rs +++ b/crates/cuda-driver/src/original_verify_window_qsa/assets.rs @@ -1,8 +1,12 @@ //! Methods of `OriginalVerifyQsaPolicy`: `mode17`, `validate`. Methods of `QsaRope`: `new`, `from_rope`, `is_identity`. //! Functions: `assets`, `cluster_assets`, `daily_assets`, `shared_attributes` and 4 more. -#[allow(unused_imports)] -use super::*; +use super::{ + ATTENTION, ATTN_CHUNK, AssetSpec, CLUSTER, CLUSTER_ENTRIES, Context, DECODE_POSTOPS, Error, GATE, KV_APPEND, + OriginalVerifyGeometry, OriginalVerifyQsaBinding, OriginalVerifyQsaKvBinding, OriginalVerifyQsaLayerWeights, + OriginalVerifyQsaPolicy, QsaRope, QsaWeightAddrs, RESOLVER, Result, RopeCorrectionRange, SELECT, SPLIT, admit, + handle, proj, +}; /// Every module a QSA producer may launch from; the lead preloads them before capture. The cluster module is not in /// this list: it is loaded only when the policy asks for the cluster top-k (`cluster_assets`), since a card below sm_90 diff --git a/crates/cuda-driver/src/original_verify_window_qsa/qsa_window.rs b/crates/cuda-driver/src/original_verify_window_qsa/qsa_window.rs index 7b0c1194..d8073764 100644 --- a/crates/cuda-driver/src/original_verify_window_qsa/qsa_window.rs +++ b/crates/cuda-driver/src/original_verify_window_qsa/qsa_window.rs @@ -1,8 +1,13 @@ //! Groups the submodules `qsa_window_prelude_rows`, `qsa_window_query_key_paths`, `qsa_window_select_and_attend`. //! Split out of `qsa` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, ATTENTION, ATTN_CHUNK, ArenaMap, Bf16GemvExtents, CLUSTER, CLUSTER_ENTRIES, CLUSTER_MAX_QUERIES, DECODE_POSTOPS, + EPS, Error, GATE, KV_APPEND, Launch, LaunchExtent, OriginalVerifyGeometry, OriginalVerifyQsaKvBinding, + OriginalVerifyQsaPolicy, PAGE_SIZE, QsaLayerAddrs, QsaRope, QsaWindow, RESOLVER, Result, RopeAbi, RopeRows, Rows, + SCORE_MAX_QUERIES, SCORE_SINGLE, SELECT, SPLIT, Span, StridedRows, declared_i32, grid_u32, max_blocks, + plan_bf16_gemv, rope_abi, scratch_floats, +}; #[path = "qsa_window/qsa_window_prelude_rows.rs"] mod qsa_window_prelude_rows; diff --git a/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_prelude_rows.rs b/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_prelude_rows.rs index 95108730..4658cd31 100644 --- a/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_prelude_rows.rs +++ b/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_prelude_rows.rs @@ -2,8 +2,7 @@ //! (`original_verify_window_qsa/fused_prelude.rs`). Same operands as the per-row plans of `qsa_kv_append` and of the //! journal's indexer append, taken from the same arena spans. -#[allow(unused_imports)] -use super::*; +use super::{Error, Launch, PAGE_SIZE, QsaLayerAddrs, QsaWindow, Result, Rows}; use crate::original_verify::qsa::fused_prelude::{ self, IndexImage, IndexRowsOperands, KvRowsOperands, KvRowsShape, plan_index_rows, plan_kv_rows, }; diff --git a/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_query_key_paths.rs b/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_query_key_paths.rs index c114e201..0459ec45 100644 --- a/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_query_key_paths.rs +++ b/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_query_key_paths.rs @@ -1,8 +1,11 @@ //! Methods of `QsaWindow`: `new`, `span`, `rows`, `rms` and 12 more. Functions: `append_launch`. //! Split out of `qsa_window` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, ArenaMap, Bf16GemvExtents, DECODE_POSTOPS, EPS, Error, KV_APPEND, Launch, LaunchExtent, OriginalVerifyGeometry, + OriginalVerifyQsaKvBinding, OriginalVerifyQsaPolicy, PAGE_SIZE, QsaLayerAddrs, QsaRope, QsaWindow, Result, RopeAbi, + RopeRows, Rows, SPLIT, Span, StridedRows, declared_i32, grid_u32, plan_bf16_gemv, rope_abi, +}; impl<'a> QsaWindow<'a> { pub fn new( diff --git a/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_select_and_attend.rs b/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_select_and_attend.rs index f8f2adc9..7013d241 100644 --- a/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_select_and_attend.rs +++ b/crates/cuda-driver/src/original_verify_window_qsa/qsa_window/qsa_window_select_and_attend.rs @@ -1,8 +1,11 @@ //! Methods of `QsaWindow`: `block_scores_topk`, `scores_launch`, `topk_launch`, `kv_resolve` and 5 more. //! Defines `AttnDims`, `AttnSpans`. -#[allow(unused_imports)] -use super::*; +use super::{ + A, ATTENTION, ATTN_CHUNK, CLUSTER, CLUSTER_ENTRIES, CLUSTER_MAX_QUERIES, Error, GATE, Launch, LaunchExtent, + PAGE_SIZE, QsaLayerAddrs, QsaWindow, RESOLVER, Result, Rows, SCORE_MAX_QUERIES, SCORE_SINGLE, SELECT, Span, + declared_i32, grid_u32, max_blocks, scratch_floats, +}; impl<'a> QsaWindow<'a> { /// `qsa_block_scores_topk`: `qsa_block_scores` then `qsa_block_topk` over the window group's queries. diff --git a/crates/cuda-driver/src/original_verify_window_qsa/tests/q_path_per_token_splits.rs b/crates/cuda-driver/src/original_verify_window_qsa/tests/q_path_per_token_splits.rs index ac6feaa1..dd0d60a4 100644 --- a/crates/cuda-driver/src/original_verify_window_qsa/tests/q_path_per_token_splits.rs +++ b/crates/cuda-driver/src/original_verify_window_qsa/tests/q_path_per_token_splits.rs @@ -4,8 +4,10 @@ //! scores_use_the_multi_query_kernel_then_the_radix_topk, //! the_single_query_score_kernel_is_used_without_the_multi_policy .... -#[allow(unused_imports)] -use super::*; +use super::{ + A, BASE, Error, GATE, KV, Launch, LayoutMap, OriginalVerifyQsaPolicy, QsaLayerAddrs, QsaWindow, SCORE_SINGLE, W, + assert_abi, at, identity, layer, rows, setup, test_geometry, window, +}; #[test] fn q_path_per_token_splits_and_rotates_each_token_in_order() { diff --git a/crates/cuda-driver/src/original_verify_window_qsa/tests/sealed_assets_are_pinned.rs b/crates/cuda-driver/src/original_verify_window_qsa/tests/sealed_assets_are_pinned.rs index c379f0cc..c0e8909d 100644 --- a/crates/cuda-driver/src/original_verify_window_qsa/tests/sealed_assets_are_pinned.rs +++ b/crates/cuda-driver/src/original_verify_window_qsa/tests/sealed_assets_are_pinned.rs @@ -3,8 +3,11 @@ //! asset_set_has_distinct_names_and_the_bf16_projection_module, //! the_cluster_policy_replaces_only_the_topk_launch_and_keeps_its_arguments .... -#[allow(unused_imports)] -use super::*; +use super::{ + A, CLUSTER, Error, GATE, KV, Launch, LayoutMap, OriginalVerifyQsaPolicy, QsaRope, QsaWindow, RopeAbi, + RopeCorrectionRange, RopeRows, W, assert_abi, assets, at, cluster_assets, identity, layer, max_blocks, proj, + rope_param_count, rows, setup, shared_attributes, test_geometry, window, +}; #[test] fn sealed_assets_are_pinned_and_export_every_named_entry() { diff --git a/crates/cuda-driver/src/original_verify_window_qsa/tests/weight_sizes_are_the_original.rs b/crates/cuda-driver/src/original_verify_window_qsa/tests/weight_sizes_are_the_original.rs index e2fd4af7..9b88df1b 100644 --- a/crates/cuda-driver/src/original_verify_window_qsa/tests/weight_sizes_are_the_original.rs +++ b/crates/cuda-driver/src/original_verify_window_qsa/tests/weight_sizes_are_the_original.rs @@ -1,8 +1,10 @@ //! Tests of `tests` by topic: weight_sizes_are_the_original_tensor_shapes, //! construction_refuses_unsupported_geometry_and_policy. -#[allow(unused_imports)] -use super::*; +use super::{ + KV, OriginalVerifyQsaBinding, OriginalVerifyQsaPolicy, QsaWindow, identity, max_blocks, scratch_floats, setup, + test_geometry, +}; #[test] fn weight_sizes_are_the_original_tensor_shapes() { diff --git a/crates/cuda-driver/src/ple_batch_ffi/driver_backed.rs b/crates/cuda-driver/src/ple_batch_ffi/driver_backed.rs index 6c23715f..a3f05f75 100644 --- a/crates/cuda-driver/src/ple_batch_ffi/driver_backed.rs +++ b/crates/cuda-driver/src/ple_batch_ffi/driver_backed.rs @@ -2,7 +2,10 @@ //! Built only with the `cuda-driver` feature on 64-bit Linux and Windows; `ple_batch_ffi.rs` declares stub types for //! every other build. -use super::*; +use super::{ + BatchArg, BufferHandle, CStr, ClusterShape, Error, GdnGemmLayout, GemmDims, GemmOperands, GemmScalars, InputType, + KernelArguments, LinearLaunch, Result, combine, +}; use libc::{c_int, c_uint, c_void}; type Create = unsafe extern "C" fn(*mut *mut c_void) -> c_int; type Destroy = unsafe extern "C" fn(*mut c_void) -> c_int; diff --git a/crates/cuda-driver/src/ple_batch_ffi/driver_backed/blas.rs b/crates/cuda-driver/src/ple_batch_ffi/driver_backed/blas.rs index 04f8db2b..ae7371a4 100644 --- a/crates/cuda-driver/src/ple_batch_ffi/driver_backed/blas.rs +++ b/crates/cuda-driver/src/ple_batch_ffi/driver_backed/blas.rs @@ -1,8 +1,10 @@ //! Methods of `Blas`: `load`, `init_handle`, `stream`, `gemm` and 7 more. //! Functions: `gemm_shape_admitted`, `gdn_shape_admitted`, `gdn_bf16_shape_admitted`, `gdn_f16_shape_admitted`. -#[allow(unused_imports)] -use super::*; +use super::{ + Blas, BufferHandle, Create, Destroy, Error, GdnGemmLayout, Gemm, GemmDims, GemmOperands, GemmScalars, InputType, + Library, Result, SetMath, SetStream, SetWorkspace, StreamCreate, c_void, check, combine, +}; impl Blas { pub(crate) fn load(workspace: BufferHandle, bytes: usize) -> Result { diff --git a/crates/cuda-driver/src/ple_batch_ffi/driver_backed/kernel_module_launch_and_close.rs b/crates/cuda-driver/src/ple_batch_ffi/driver_backed/kernel_module_launch_and_close.rs index 60eea8fd..b00bce01 100644 --- a/crates/cuda-driver/src/ple_batch_ffi/driver_backed/kernel_module_launch_and_close.rs +++ b/crates/cuda-driver/src/ple_batch_ffi/driver_backed/kernel_module_launch_and_close.rs @@ -1,8 +1,11 @@ //! Methods of `Blas`: `close_inner`. //! Methods of `KernelModule`: `load`, `init_functions`, `launch`, `launch_dynamic` and 5 more. -#[allow(unused_imports)] -use super::*; +use super::{ + BatchArg, Blas, CStr, ClusterShape, Destroy, Error, FuncSetAttribute, KernelArguments, KernelModule, Launch, + LaunchAttribute, LaunchConfig, LaunchEx, Library, LinearLaunch, ModuleFunction, ModuleLoad, Result, c_int, c_void, + check, combine, +}; impl Blas { pub(super) fn close_inner(&mut self) -> Result<()> { diff --git a/crates/cuda-driver/src/ple_batch_ffi/driver_backed/library.rs b/crates/cuda-driver/src/ple_batch_ffi/driver_backed/library.rs index f5c57501..2dbc80b2 100644 --- a/crates/cuda-driver/src/ple_batch_ffi/driver_backed/library.rs +++ b/crates/cuda-driver/src/ple_batch_ffi/driver_backed/library.rs @@ -1,8 +1,7 @@ //! Methods of `Library`: `open`. Implements `Drop for Library`. Functions: `check`. //! Split out of `enabled` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{CStr, Error, Library, Result, c_int}; impl Library { pub(super) fn open(name: &'static CStr) -> Result { diff --git a/crates/cuda-driver/src/ple_batch_ffi/kernel_arguments.rs b/crates/cuda-driver/src/ple_batch_ffi/kernel_arguments.rs index 24cab0b3..49a96990 100644 --- a/crates/cuda-driver/src/ple_batch_ffi/kernel_arguments.rs +++ b/crates/cuda-driver/src/ple_batch_ffi/kernel_arguments.rs @@ -1,8 +1,7 @@ //! Methods of `KernelArguments`: `new`. Methods of `Blas`: `load`, `stream`, `gemm_bf16`, `gemm_f16` and 4 more. //! Split out of `ple_batch_ffi` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{BatchArg, KernelArguments}; impl KernelArguments { pub(crate) fn new(values: Vec) -> Self { diff --git a/crates/cuda-driver/src/ple_batch_queue/assets.rs b/crates/cuda-driver/src/ple_batch_queue/assets.rs index 252a780a..5df09b44 100644 --- a/crates/cuda-driver/src/ple_batch_queue/assets.rs +++ b/crates/cuda-driver/src/ple_batch_queue/assets.rs @@ -1,8 +1,11 @@ //! Methods of `PleBatchCompletion`: `rows`, `numerical_refusal`, `take_row`. //! Methods of `PleBatchQueue`: `read_row`, `settle_row`. Functions: `assets`, `check_ptx`. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Context, Error, PACK_PTX, PACK_PTX_BYTES, PACK_PTX_SHA256, PTX, PTX_BYTES, PTX_SHA256, + PleBatchCompletion, PleBatchQueue, PleBatchRow, PleBf16Mode, PleClosedRefusal, REFUSALS, Result, combine, decode, + float_owner, staging, +}; pub(super) fn assets() -> Result<[&'static [u8]; 2]> { check_ptx(PTX_SHA256, PTX_BYTES, PTX)?; diff --git a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_drop.rs b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_drop.rs index 60b56a9f..bfc3a540 100644 --- a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_drop.rs +++ b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_drop.rs @@ -1,8 +1,7 @@ //! Methods of `Command`: `launch`. Methods of `ScanExtent`: `new`. Implements `Drop for PleBatchQueue`. //! Functions: `push`, `scan`, `staging`, `float_staging` and 2 more. Defines `ScanExtent`. -#[allow(unused_imports)] -use super::*; +use super::{A, Blas, BufferHandle, Command, Error, KernelArguments, KernelModule, PleBatchQueue, Result}; use crate::ple_batch_ffi::{GemmDims, GemmOperands, GemmScalars, LinearLaunch}; impl Drop for PleBatchQueue<'_> { diff --git a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations.rs b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations.rs index 41946308..073da796 100644 --- a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations.rs +++ b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations.rs @@ -2,8 +2,11 @@ //! compose. //! One impl split over these files so that each stays under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, Blas, BufferHandle, Command, Context, DeviceBuffer, ENTRIES, Error, KernelModule, NativeBatchWorkspace, + PACK_ENTRIES, PLE_BATCH_QUEUE_BYTES, PleBatchCompletion, PleBatchQueue, PleBatchSources, PleBf16Mode, + PleClosedWeights, RESERVE, Result, SIZES, ScanExtent, assets, combine, float_staging, push, scan, staging, +}; mod compose_phases; mod ple_batch_queue_bring_up; diff --git a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/compose_phases.rs b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/compose_phases.rs index 88d15334..f4bd7bc4 100644 --- a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/compose_phases.rs +++ b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/compose_phases.rs @@ -1,7 +1,9 @@ //! STRA-338 size: the phases of `PleBatchQueue::compose`, extracted in command order. -#[allow(unused_imports)] -use super::*; +use super::{ + A, Blas, BufferHandle, Command, Error, KernelModule, NativeBatchWorkspace, PleBatchCompletion, PleBatchQueue, + PleBf16Mode, PleClosedWeights, Result, ScanExtent, combine, float_staging, push, scan, staging, +}; /// Device spans, weights and the row count one batch compose shares. pub(super) struct BatchPlan { diff --git a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_bring_up.rs b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_bring_up.rs index 0e6f555b..7ca3ab91 100644 --- a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_bring_up.rs +++ b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_bring_up.rs @@ -1,8 +1,10 @@ //! Methods of `PleBatchQueue`: `new`, `new_capacity`, `init_resources`, `load_modules` and 9 more. //! Functions: `batch_sizes`, `check_required`. -#[allow(unused_imports)] -use super::*; +use super::{ + BufferHandle, Context, DeviceBuffer, ENTRIES, Error, KernelModule, PACK_ENTRIES, PLE_BATCH_QUEUE_BYTES, + PleBatchQueue, PleBf16Mode, RESERVE, Result, SIZES, assets, combine, +}; impl<'ctx> PleBatchQueue<'ctx> { pub(in super::super) fn new(context: &'ctx Context<'ctx>, mode: PleBf16Mode) -> Result { diff --git a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_close.rs b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_close.rs index 0fb7b8e1..095c1c2f 100644 --- a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_close.rs +++ b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_close.rs @@ -1,8 +1,7 @@ //! Methods of `PleBatchQueue`: `close`, `close_inner`, `close_guard`. Functions: `close_or_leak`, `poison_on_error`. //! Split out of `ple_batch_queue_methods` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, Error, PleBatchQueue, Result, combine}; use crate::CurrentGuard; impl<'ctx> PleBatchQueue<'ctx> { diff --git a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_compose.rs b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_compose.rs index c07afd2f..f7008397 100644 --- a/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_compose.rs +++ b/crates/cuda-driver/src/ple_batch_queue/ple_batch_queue_operations/ple_batch_queue_compose.rs @@ -3,7 +3,7 @@ #[allow(unused_imports)] use super::compose_phases::BatchHost; -use super::*; +use super::{NativeBatchWorkspace, PleBatchCompletion, PleBatchQueue, PleBatchSources, PleClosedWeights, Result}; impl<'ctx> PleBatchQueue<'ctx> { /// Literal original batch profile, explicit hi-only or hi+low; no automatic diff --git a/crates/cuda-driver/src/ple_closed_queue.rs b/crates/cuda-driver/src/ple_closed_queue.rs index b2c66fbd..7e5e115e 100644 --- a/crates/cuda-driver/src/ple_closed_queue.rs +++ b/crates/cuda-driver/src/ple_closed_queue.rs @@ -1,6 +1,9 @@ //! Same whole PLE operators in one completed, ordered finite-checked queue. //! Completion owns real final readbacks; it has no session/row/history authority. -use super::*; +use super::{ + Admission, Arguments, Context, DeviceBuffer, Error, Operation, Result, admission, combine, ffi, qwen_ffi, + registered, +}; const SIZES: [usize; 14] = [10240, 40960, 368640, 40960, 10240, 40960, 40960, 16, 40960, 40960, 40960, 368640, 40960, 40]; diff --git a/crates/cuda-driver/src/ple_closed_queue/compose_phases.rs b/crates/cuda-driver/src/ple_closed_queue/compose_phases.rs index 0dcc4587..64cc835c 100644 --- a/crates/cuda-driver/src/ple_closed_queue/compose_phases.rs +++ b/crates/cuda-driver/src/ple_closed_queue/compose_phases.rs @@ -1,7 +1,9 @@ //! STRA-338 size: the phases of `PleClosedQueue::compose`, extracted in command order. -#[allow(unused_imports)] -use super::*; +use super::{ + Command, Error, Operation, PleClosedCompletion, PleClosedQueue, PleClosedWeights, Result, combine, ffi, + float_owner, float_staging, qwen_ffi, staging, +}; /// Host buffers one compose stages its uploads in and reads its results back into. pub(super) struct ComposeHost { diff --git a/crates/cuda-driver/src/ple_closed_queue/float_owner.rs b/crates/cuda-driver/src/ple_closed_queue/float_owner.rs index 31e00ef4..c3cbd70b 100644 --- a/crates/cuda-driver/src/ple_closed_queue/float_owner.rs +++ b/crates/cuda-driver/src/ple_closed_queue/float_owner.rs @@ -1,8 +1,7 @@ //! Methods of `Command`: `launch`. Functions: `float_owner`. //! Split out of `ple_closed_queue` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Command, Context, Error, Result}; pub(super) fn float_owner(count: usize) -> Result> { let mut result = Vec::new(); diff --git a/crates/cuda-driver/src/ple_closed_queue/ple_closed_completion.rs b/crates/cuda-driver/src/ple_closed_queue/ple_closed_completion.rs index cd86fdba..bc830ba6 100644 --- a/crates/cuda-driver/src/ple_closed_queue/ple_closed_completion.rs +++ b/crates/cuda-driver/src/ple_closed_queue/ple_closed_completion.rs @@ -1,8 +1,11 @@ //! Methods of `PleClosedCompletion`: `numerical_refusal`, `into_parts`. Methods of `Context`: `ple_closed_queue`. //! Functions: `check_charge`. -#[allow(unused_imports)] -use super::*; +use super::{ + Admission, Arguments, CHARGE, Command, Context, DeviceBuffer, Error, OPS, OUTPUTS, Operation, PleClosedCompletion, + PleClosedParts, PleClosedQueue, PleClosedRefusal, REFUSALS, RESERVE, Result, SIZES, admission, combine, ffi, + qwen_ffi, registered, +}; impl PleClosedCompletion<'_, '_> { pub fn numerical_refusal(&self) -> Option { diff --git a/crates/cuda-driver/src/ple_closed_queue/ple_closed_queue_compose_close.rs b/crates/cuda-driver/src/ple_closed_queue/ple_closed_queue_compose_close.rs index 7c7da5a9..55cbd9a7 100644 --- a/crates/cuda-driver/src/ple_closed_queue/ple_closed_queue_compose_close.rs +++ b/crates/cuda-driver/src/ple_closed_queue/ple_closed_queue_compose_close.rs @@ -3,7 +3,9 @@ #[allow(unused_imports)] use super::compose_phases::ComposeHost; -use super::*; +use super::{ + Context, DeviceBuffer, Error, PleClosedCompletion, PleClosedQueue, PleClosedWeights, Result, combine, ffi, +}; impl<'ctx> PleClosedQueue<'ctx> { /// All actual weights are borrowed through the completed drain. No source, diff --git a/crates/cuda-driver/src/prefill_stage_gdn_gpu/enable_types.rs b/crates/cuda-driver/src/prefill_stage_gdn_gpu/enable_types.rs index aa69b116..c1943853 100644 --- a/crates/cuda-driver/src/prefill_stage_gdn_gpu/enable_types.rs +++ b/crates/cuda-driver/src/prefill_stage_gdn_gpu/enable_types.rs @@ -1,8 +1,7 @@ //! Defines `Rng`, `Old`. //! ENABLE, Rng, Old. -#[allow(unused_imports)] -use super::*; +use super::{Context, Functions}; pub(super) const ENABLE: &str = "LELEKA_PREFILL_STAGE_GPU"; diff --git a/crates/cuda-driver/src/prefill_stage_gdn_gpu/gdn_recurrence_equals_the_original.rs b/crates/cuda-driver/src/prefill_stage_gdn_gpu/gdn_recurrence_equals_the_original.rs index fac189a1..1cd9b444 100644 --- a/crates/cuda-driver/src/prefill_stage_gdn_gpu/gdn_recurrence_equals_the_original.rs +++ b/crates/cuda-driver/src/prefill_stage_gdn_gpu/gdn_recurrence_equals_the_original.rs @@ -1,8 +1,10 @@ //! Tests of prefill_stage_gdn_gpu by topic (moved out of the test file by STRA-338): //! gdn_recurrence_equals_the_original_bit_for_bit, gdn_recurrence_kh_equals_the_original_bit_for_bit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, Context, DeviceBuffer, ENABLE, Kernel, KernelArguments, KernelModule, Old, Rng, download, f32_bytes, ffi, hd, + upload, words, +}; use crate::ple_batch_ffi::LinearLaunch; /// The device, the original kernels' launcher and the staged-kernel module shared by the GDN proofs. diff --git a/crates/cuda-driver/src/prefill_stage_gdn_gpu/gdn_tensor_core_scan_parity.rs b/crates/cuda-driver/src/prefill_stage_gdn_gpu/gdn_tensor_core_scan_parity.rs index 134ed0f1..a681e8df 100644 --- a/crates/cuda-driver/src/prefill_stage_gdn_gpu/gdn_tensor_core_scan_parity.rs +++ b/crates/cuda-driver/src/prefill_stage_gdn_gpu/gdn_tensor_core_scan_parity.rs @@ -8,8 +8,7 @@ //! Every case is run and printed before the verdict, so one run shows all failures (`PREFILL-GDN-TC` lines). use super::gdn_recurrence_equals_the_original::{Rig, with_rig}; -#[allow(unused_imports)] -use super::*; +use super::{A, Context, DeviceBuffer, KernelArguments, KernelModule, Rng, download, f32_bytes, hd, upload, words}; use crate::gdn_prefill_tc as tc; use crate::ple_batch_ffi::LinearLaunch; diff --git a/crates/cuda-driver/src/prefill_stage_gdn_gpu/rng.rs b/crates/cuda-driver/src/prefill_stage_gdn_gpu/rng.rs index 9a9a8224..81c9bcab 100644 --- a/crates/cuda-driver/src/prefill_stage_gdn_gpu/rng.rs +++ b/crates/cuda-driver/src/prefill_stage_gdn_gpu/rng.rs @@ -1,8 +1,7 @@ //! Methods of `Rng`: `next`, `f`, `f16`. Methods of `Old`: `run`. //! Functions: `f32_bytes`, `upload`, `hd`, `download` and 2 more. -#[allow(unused_imports)] -use super::*; +use super::{A, Context, DeviceBuffer, GdnStream, Kernel, KernelArguments, KernelModule, Old, Rng, ffi}; use crate::ple_batch_ffi::LinearLaunch; impl Rng { diff --git a/crates/cuda-driver/src/prefill_stage_gr_gpu/enable_types.rs b/crates/cuda-driver/src/prefill_stage_gr_gpu/enable_types.rs index 5be21dd8..eb0280d7 100644 --- a/crates/cuda-driver/src/prefill_stage_gr_gpu/enable_types.rs +++ b/crates/cuda-driver/src/prefill_stage_gr_gpu/enable_types.rs @@ -1,8 +1,7 @@ //! Defines `Rng`, `Launch`. //! ENABLE, Rng, Launch. -#[allow(unused_imports)] -use super::*; +use super::{A, KernelModule}; pub(super) const ENABLE: &str = "LELEKA_PREFILL_STAGE_GPU"; diff --git a/crates/cuda-driver/src/prefill_stage_gr_gpu/gr_fused_guards_equal.rs b/crates/cuda-driver/src/prefill_stage_gr_gpu/gr_fused_guards_equal.rs index 596acce8..da6020a4 100644 --- a/crates/cuda-driver/src/prefill_stage_gr_gpu/gr_fused_guards_equal.rs +++ b/crates/cuda-driver/src/prefill_stage_gr_gpu/gr_fused_guards_equal.rs @@ -1,8 +1,10 @@ //! Tests of prefill_stage_gr_gpu by topic (moved out of the test file by STRA-338): //! gr_fused_guards_equal_the_separate_guard_kernels_bit_for_bit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, Context, DeviceBuffer, ENABLE, GR_ENTRIES, GR_PTX, KernelModule, Launch, NativeBatchWorkspace, Rng, download, + f32_bytes, h, run_all, upload, +}; /// Token rows of every case. const T: usize = 77; diff --git a/crates/cuda-driver/src/prefill_stage_gr_gpu/gr_kernels_run_near_their.rs b/crates/cuda-driver/src/prefill_stage_gr_gpu/gr_kernels_run_near_their.rs index 46b564cf..3fe51e1a 100644 --- a/crates/cuda-driver/src/prefill_stage_gr_gpu/gr_kernels_run_near_their.rs +++ b/crates/cuda-driver/src/prefill_stage_gr_gpu/gr_kernels_run_near_their.rs @@ -1,8 +1,7 @@ //! Tests of prefill_stage_gr_gpu by topic (moved out of the test file by STRA-338): //! gr_kernels_run_near_their_traffic_floor_at_chunk_size. -#[allow(unused_imports)] -use super::*; +use super::{A, Context, DeviceBuffer, ENABLE, KernelArguments, KernelModule, Rng, f32_bytes, h, upload}; use crate::ple_batch_ffi::LinearLaunch; /// Timing only (row "256k prefill gap"): the three hyper-connection kernels of the prompt at the real chunk size diff --git a/crates/cuda-driver/src/prefill_stage_gr_gpu/rng.rs b/crates/cuda-driver/src/prefill_stage_gr_gpu/rng.rs index 559ed684..14ee023f 100644 --- a/crates/cuda-driver/src/prefill_stage_gr_gpu/rng.rs +++ b/crates/cuda-driver/src/prefill_stage_gr_gpu/rng.rs @@ -1,8 +1,7 @@ //! Methods of `Rng`: `next`. Functions: `f32_bytes`, `upload`, `h`, `download` and 1 more. //! Split out of `gr_gpu_tests` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{BufferHandle, Context, DeviceBuffer, KernelArguments, Launch, NativeBatchWorkspace, Rng}; use crate::ple_batch_ffi::LinearLaunch; impl Rng { diff --git a/crates/cuda-driver/src/projection_grids_and_bounds.rs b/crates/cuda-driver/src/projection_grids_and_bounds.rs index cf88306b..efab9b9a 100644 --- a/crates/cuda-driver/src/projection_grids_and_bounds.rs +++ b/crates/cuda-driver/src/projection_grids_and_bounds.rs @@ -1,8 +1,7 @@ //! Functions: `q4_k_native_indices_fit`, `q4_k_last_signed_byte_offset`, `bounded_projection_size`, `check_projectio... //! Split out of `crate` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{DenseFormat, Error, ProjectionKind, ProjectionShape, ProjectionSpec, Q5KShape, Result, ffi, valid_size}; const Q4_K_BLOCK: usize = 256; const Q4_K_BLOCK_BYTES: usize = 144; diff --git a/crates/cuda-driver/src/prompt_sync_trace_types.rs b/crates/cuda-driver/src/prompt_sync_trace_types.rs index 630c2902..cba92c3f 100644 --- a/crates/cuda-driver/src/prompt_sync_trace_types.rs +++ b/crates/cuda-driver/src/prompt_sync_trace_types.rs @@ -1,8 +1,9 @@ //! Defines `PromptSyncTrace`, `Driver`, `Device` and 8 more. //! PromptSyncTrace, Error, Result, Bf16ProjectionShape, Driver, Device .... -#[allow(unused_imports)] -use super::*; +use super::{Cell, DeviceBuffer, Rc, RefCell, experimental, ffi, kar_decode_levels, qwen_dispatch}; +#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))] +use super::original_verify; // The plain error, format and geometry types live in `leleka-cuda-model` (STRA-338 S24); the paths are unchanged. pub use leleka_cuda_model::{ diff --git a/crates/cuda-driver/src/prompt_sync_trace_types/retained.rs b/crates/cuda-driver/src/prompt_sync_trace_types/retained.rs index 04f073d5..b909d156 100644 --- a/crates/cuda-driver/src/prompt_sync_trace_types/retained.rs +++ b/crates/cuda-driver/src/prompt_sync_trace_types/retained.rs @@ -1,7 +1,8 @@ //! The host-side lists a `Context` keeps for the verify-window modules and the deferred buffer frees. -#[allow(unused_imports)] -use super::*; +use super::{Rc, RefCell, ffi}; +#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))] +use super::original_verify; /// Lists that live and die with the context: both start empty. #[derive(Default)] diff --git a/crates/cuda-driver/src/q5_kshape_types.rs b/crates/cuda-driver/src/q5_kshape_types.rs index 283fc85c..638b5f60 100644 --- a/crates/cuda-driver/src/q5_kshape_types.rs +++ b/crates/cuda-driver/src/q5_kshape_types.rs @@ -1,8 +1,7 @@ //! Defines `Q5KShape`, `Q6KShape`, `MatvecShape` and 2 more. //! Q5KShape, Q6KShape, MatvecShape, CurrentGuard, DeviceBuffer. -#[allow(unused_imports)] -use super::*; +use super::{Context, PhantomData, Rc, ffi}; #[derive(Debug, PartialEq, Eq)] pub(super) struct Q5KShape { diff --git a/crates/cuda-driver/src/q6_k_shape.rs b/crates/cuda-driver/src/q6_k_shape.rs index 97738721..dfd983e3 100644 --- a/crates/cuda-driver/src/q6_k_shape.rs +++ b/crates/cuda-driver/src/q6_k_shape.rs @@ -1,8 +1,7 @@ //! Functions: `q6_k_shape`, `q6_abi_extents`, `q6_checked_bytes`, `q6_grids` and 4 more. //! Split out of `crate` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Error, MatvecShape, Q6KShape, Result, ffi, valid_size}; pub(super) fn q6_k_shape(rows: usize, columns: usize) -> Result { let (rows_abi, columns_abi) = q6_abi_extents(rows, columns)?; diff --git a/crates/cuda-driver/src/q6_layer_preview.rs b/crates/cuda-driver/src/q6_layer_preview.rs index 543db38a..1a4e4fdf 100644 --- a/crates/cuda-driver/src/q6_layer_preview.rs +++ b/crates/cuda-driver/src/q6_layer_preview.rs @@ -1,5 +1,7 @@ //! Unqualified isolated layer bounded Q6_K column seam. No production asset admission. -use super::*; +use super::{ + Cell, Context, DeviceBuffer, Error, FixedOperation, Q6KShape, Rc, Result, combine, ffi, q6_k_shape, valid_size, +}; fn shape(rows: usize, columns: usize, tokens: usize) -> Result<(Q6KShape, usize, usize, usize)> { if !(1..=64).contains(&tokens) { return Err(Error::InvalidQ6KProjectionShape); diff --git a/crates/cuda-driver/src/qsa_index_ffi/driver_backed.rs b/crates/cuda-driver/src/qsa_index_ffi/driver_backed.rs index 017c8c9f..cc5cfb1c 100644 --- a/crates/cuda-driver/src/qsa_index_ffi/driver_backed.rs +++ b/crates/cuda-driver/src/qsa_index_ffi/driver_backed.rs @@ -3,7 +3,7 @@ //! Built only with the `cuda-driver` feature on 64-bit Linux and Windows; `qsa_index_ffi.rs` declares stub types for //! every other build. -use super::*; +use super::{Arguments, Entry, Error, Launch, Result, Value, combine}; use libc::{c_int, c_uint, c_void}; type Load = unsafe extern "C" fn(*mut *mut c_void, *const c_void) -> c_int; type Function = unsafe extern "C" fn(*mut *mut c_void, *mut c_void, *const libc::c_char) -> c_int; diff --git a/crates/cuda-driver/src/qsa_late_gpu/rng.rs b/crates/cuda-driver/src/qsa_late_gpu/rng.rs index cdf097fc..3941d94a 100644 --- a/crates/cuda-driver/src/qsa_late_gpu/rng.rs +++ b/crates/cuda-driver/src/qsa_late_gpu/rng.rs @@ -1,8 +1,7 @@ //! Methods of `Rng`: `next`. Functions: `upload`, `download`, `with_gpu`, `handle` and 8 more. //! Split out of `gpu_tests` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{A, CAP, Context, DeviceBuffer, Driver, ENABLE, KernelArguments, Rng, SelectionRig, TOPK_FAST, scan_both}; use crate::ple_batch_ffi::LinearLaunch; impl Rng { diff --git a/crates/cuda-driver/src/qsa_late_gpu/scan_both.rs b/crates/cuda-driver/src/qsa_late_gpu/scan_both.rs index a01a9a30..306771e3 100644 --- a/crates/cuda-driver/src/qsa_late_gpu/scan_both.rs +++ b/crates/cuda-driver/src/qsa_late_gpu/scan_both.rs @@ -1,8 +1,10 @@ //! Functions: `scan_both`, `bench_cases`, `bench_scores`, `topk_variants` and 4 more. //! Split out of `gpu_tests` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, BenchRig, CAP, Context, DeviceBuffer, KernelArguments, Rng, Run, SCORE_SCAN_FAST, SelectionRig, TOPK_FAST, + TOPK_SAMPLE, TOPK_WIDE, TOPK_WIDE_FAILED, download, f32_raw, handle, step_bytes, topk_args, upload, +}; use crate::ple_batch_ffi::{ClusterShape, LinearLaunch}; /// The Original's score scan and the late fast scan over the same scores; returns both status buffers. diff --git a/crates/cuda-driver/src/qsa_late_gpu/time_scores_and_topk.rs b/crates/cuda-driver/src/qsa_late_gpu/time_scores_and_topk.rs index 5b598b40..d2ad47ab 100644 --- a/crates/cuda-driver/src/qsa_late_gpu/time_scores_and_topk.rs +++ b/crates/cuda-driver/src/qsa_late_gpu/time_scores_and_topk.rs @@ -1,8 +1,9 @@ //! Functions: `time_scores_and_topk`, `time_warm`. //! Split out of `gpu_tests` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + A, CAP, Context, DeviceBuffer, KernelArguments, KernelModule, Rng, decode_inputs, handle, topk_args, upload, +}; use crate::ple_batch_ffi::LinearLaunch; /// Times the decode scores kernel and the top-k at one `(pos, nq)` shape, 20 warm launches each. diff --git a/crates/cuda-driver/src/qsa_mapped_journal.rs b/crates/cuda-driver/src/qsa_mapped_journal.rs index 37e8b675..c1416bea 100644 --- a/crates/cuda-driver/src/qsa_mapped_journal.rs +++ b/crates/cuda-driver/src/qsa_mapped_journal.rs @@ -1,6 +1,12 @@ //! Original positional mapped KV is one authoritative initialized-address owner. //! Prefix checkpoints are coverage, not byte copies or finite certificates. -use super::*; +use super::{ + Arg, Arguments, Context, DeviceBuffer, Error, LaunchGeometry, NativeBatchWorkspace, OriginalQsaResidentTransport, + PoolAddresses, QSA_PROMPT_HOST_PAGE_BYTES, QsaKvOwnerId, QsaPromptKv, Rc, Result, SelectedRows, checked, + stage_runs, +}; +#[cfg(test)] +use super::PAGE; use crate::OriginalDeviceGrRead; use std::cell::Cell; struct Coverage { diff --git a/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_journal.rs b/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_journal.rs index 4cd4e6ad..79d9a4db 100644 --- a/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_journal.rs +++ b/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_journal.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalQsaMappedJournal`: `append_resident_decode`, `completed_kv_handles`, `admit_append`, `reject_... //! Defines `AppendPlan`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, Cell, Context, Coverage, Error, LaunchGeometry, NativeBatchWorkspace, OriginalQsaMappedAppend, + OriginalQsaMappedJournal, OriginalQsaMappedPrefix, OriginalQsaResidentTransport, QSA_PROMPT_HOST_PAGE_BYTES, Rc, + Result, checked, +}; impl<'ctx> OriginalQsaMappedJournal<'ctx> { pub fn append_resident_decode( diff --git a/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix.rs b/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix.rs index 68ce865d..b5f19edb 100644 --- a/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix.rs +++ b/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix.rs @@ -1,8 +1,11 @@ //! Groups the submodules `qsa_mapped_journal_append_and_resolve`, `qsa_mapped_journal_prefix_and_prefetch`. //! Split out of `mapped_journal` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Cell, Context, Coverage, DeviceBuffer, Error, NativeBatchWorkspace, OriginalDeviceGrRead, OriginalQsaMappedAppend, + OriginalQsaMappedJournal, OriginalQsaMappedPrefix, OriginalQsaResidentTransport, PoolAddresses, QsaKvOwnerId, + QsaPromptKv, Rc, Result, SelectedRows, checked, stage_runs, +}; #[path = "original_qsa_mapped_prefix/qsa_mapped_journal_append_and_resolve.rs"] mod qsa_mapped_journal_append_and_resolve; diff --git a/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix/qsa_mapped_journal_append_and_resolve.rs b/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix/qsa_mapped_journal_append_and_resolve.rs index c390e801..f69a3e6d 100644 --- a/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix/qsa_mapped_journal_append_and_resolve.rs +++ b/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix/qsa_mapped_journal_append_and_resolve.rs @@ -3,7 +3,10 @@ #[allow(unused_imports)] use super::super::original_qsa_mapped_journal::AppendPlan; -use super::*; +use super::{ + DeviceBuffer, Error, NativeBatchWorkspace, OriginalQsaMappedAppend, OriginalQsaMappedJournal, + OriginalQsaMappedPrefix, OriginalQsaResidentTransport, PoolAddresses, Result, SelectedRows, checked, stage_runs, +}; impl<'ctx> OriginalQsaMappedJournal<'ctx> { /// Whole original mapped storage/staging has fixed addresses. Only new cells are written; preceding prefix bytes diff --git a/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix/qsa_mapped_journal_prefix_and_prefetch.rs b/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix/qsa_mapped_journal_prefix_and_prefetch.rs index 29fd3cb2..75d572a0 100644 --- a/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix/qsa_mapped_journal_prefix_and_prefetch.rs +++ b/crates/cuda-driver/src/qsa_mapped_journal/original_qsa_mapped_prefix/qsa_mapped_journal_prefix_and_prefetch.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalQsaMappedPrefix`: `next_position`, `owner_id`, `validate_retained`. //! Methods of `OriginalQsaMappedAppend`: `rows`, `first_position`, `prefix_after`, `final_prefix`. -#[allow(unused_imports)] -use super::*; +use super::{ + Cell, Context, Coverage, Error, NativeBatchWorkspace, OriginalDeviceGrRead, OriginalQsaMappedAppend, + OriginalQsaMappedJournal, OriginalQsaMappedPrefix, OriginalQsaResidentTransport, QsaKvOwnerId, QsaPromptKv, Rc, + Result, stage_runs, +}; impl OriginalQsaMappedPrefix { pub fn next_position(&self) -> usize { diff --git a/crates/cuda-driver/src/qsa_native_batch.rs b/crates/cuda-driver/src/qsa_native_batch.rs index 915117b5..df368b03 100644 --- a/crates/cuda-driver/src/qsa_native_batch.rs +++ b/crates/cuda-driver/src/qsa_native_batch.rs @@ -1,6 +1,6 @@ //! Closed Original prompt K/V/Q and index projections; no decode substitution. //! Registration/export and sealed assets are owned by Root integration. -use super::*; +use super::{Context, DeviceBuffer, Error, Result, combine, ffi}; use crate::NativeBatchWorkspace; use crate::ple_batch_ffi::{BatchArg as A, KernelArguments, KernelModule}; diff --git a/crates/cuda-driver/src/qsa_native_batch/native_projections.rs b/crates/cuda-driver/src/qsa_native_batch/native_projections.rs index 82f21f58..75aec2f5 100644 --- a/crates/cuda-driver/src/qsa_native_batch/native_projections.rs +++ b/crates/cuda-driver/src/qsa_native_batch/native_projections.rs @@ -1,8 +1,11 @@ //! Methods of `QsaNativeBatchWorkspace`: `project`, `project_io`, `launch_project`, `reset_status` and 10 more. //! Methods of `ProjectionShape`: `new`, `inputs`. Implements `Drop for QsaNativeBatchWorkspace`. -#[allow(unused_imports)] -use super::*; +use super::{ + A, DeviceBuffer, Error, KernelArguments, KernelModule, NativeBatchWorkspace, QsaGatedAttention, QsaInputWeights, + QsaNativeBatchWorkspace, QsaNativeKind, QsaNativePacking, QsaNativeProjections, QsaNativeWeight, Result, combine, + ffi, +}; use crate::ple_batch_ffi::LinearLaunch; use crate::ple_batch_ffi::{GemmDims, GemmOperands, GemmScalars}; diff --git a/crates/cuda-driver/src/qsa_native_batch/qsa_native_kind.rs b/crates/cuda-driver/src/qsa_native_batch/qsa_native_kind.rs index 82ae0249..5ef24352 100644 --- a/crates/cuda-driver/src/qsa_native_batch/qsa_native_kind.rs +++ b/crates/cuda-driver/src/qsa_native_batch/qsa_native_kind.rs @@ -1,8 +1,10 @@ //! Methods of `QsaNativeKind`: `entry`, `block`. //! Methods of `Context`: `qsa_native_batch_workspace`, `qsa_native_batch_workspace_for_prompt`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DEQUANT_PTX, DeviceBuffer, Error, KernelModule, NativeBatchWorkspace, PTX, QsaNativeBatchWorkspace, + QsaNativeKind, QsaNativePacking, RESERVE, Result, SIZES, combine, ffi, +}; impl QsaNativeKind { pub(super) fn entry(self) -> usize { diff --git a/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes.rs b/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes.rs index 965a2642..26f178be 100644 --- a/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes.rs +++ b/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes.rs @@ -1,8 +1,12 @@ //! Methods of `KernelPlan`: `entry`. Defines `KernelPlan`, `KernelEntry`, `AttnPasses` and 1 more. //! Split out of `qsa_prompt_attention` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, Context, DeviceBuffer, DeviceCaps, Error, LaunchGeometry, Module, NativeBatchWorkspace, + PoolPresence, PromptAttnKernel, QWEN_SELECTION, QsaAttendedKv, QsaAttentionInputs, QsaPromptAttention, + QsaPromptAttentionCompletion, QsaPromptStage, Result, SelectSwitches, Shapes, VARIANT_ENTRIES, checked, combine, + guard_grid, select, +}; /// `kernel` as the module, the entries (guard, attention, output guard) and the dynamic shared bytes it launches. pub(super) struct KernelPlan { diff --git a/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/attention_passes.rs b/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/attention_passes.rs index 81d4e6ba..ce58130e 100644 --- a/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/attention_passes.rs +++ b/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/attention_passes.rs @@ -1,8 +1,11 @@ //! Methods of `QsaPromptAttention`: `attend_kernel`, `ensure_plan`, `validate_stage`, `output_address` and 10 more. //! Methods of `KernelPlan`: `of`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, AttnPasses, DeviceBuffer, Error, KernelPlan, LaunchGeometry, Module, NativeBatchWorkspace, + PromptAttnKernel, QsaAttendedKv, QsaAttentionInputs, QsaPromptAttention, QsaPromptAttentionCompletion, + QsaPromptStage, Result, Runner, checked, combine, guard_grid, reject_mutual_alias, +}; impl<'ctx> QsaPromptAttention<'ctx> { pub(in super::super) fn attend_kernel<'loan>( diff --git a/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/prompt_attention_owner.rs b/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/prompt_attention_owner.rs index 9abc596b..689506f3 100644 --- a/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/prompt_attention_owner.rs +++ b/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/prompt_attention_owner.rs @@ -1,8 +1,12 @@ //! Methods of `QsaPromptAttention`: `new`, `new_capacity`, `with_module`, `allocate_buffers` and 13 more. //! Split out of `attention_kernel_plan_and_passes` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arguments, Context, DeviceBuffer, DeviceCaps, Error, KernelEntry, LaunchGeometry, Module, NativeBatchWorkspace, + PoolPresence, PromptAttnKernel, QWEN_SELECTION, QsaAttendedKv, QsaAttentionInputs, QsaPromptAttention, + QsaPromptAttentionCompletion, Result, SelectSwitches, Shapes, VARIANT_ENTRIES, admit_budget, checked, combine, + select, +}; impl<'ctx> QsaPromptAttention<'ctx> { pub(in super::super) fn new(c: &'ctx Context<'ctx>) -> Result { diff --git a/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/reject_mutual_alias.rs b/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/reject_mutual_alias.rs index 061d03b0..ab6e1b71 100644 --- a/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/reject_mutual_alias.rs +++ b/crates/cuda-driver/src/qsa_prompt_attention/attention_kernel_plan_and_passes/reject_mutual_alias.rs @@ -1,8 +1,7 @@ //! Functions: `reject_mutual_alias`, `admit_budget`. //! Split out of `attention_kernel_plan_and_passes` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, Error, Result}; /// No two of the inputs overlap. pub(super) fn reject_mutual_alias(inputs: [&DeviceBuffer<'_>; 3]) -> Result<()> { diff --git a/crates/cuda-driver/src/qsa_prompt_attention/qsa_attention_inputs.rs b/crates/cuda-driver/src/qsa_prompt_attention/qsa_attention_inputs.rs index 776b041d..7d7c60f4 100644 --- a/crates/cuda-driver/src/qsa_prompt_attention/qsa_attention_inputs.rs +++ b/crates/cuda-driver/src/qsa_prompt_attention/qsa_attention_inputs.rs @@ -1,8 +1,7 @@ //! Methods of `QsaAttentionInputs`: `new`. //! Methods of `Context`: `qsa_prompt_attention`, `qsa_prompt_attention_for_capacity`. -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, Error, QsaAttentionInputs, QsaPromptAttention, Result, checked}; impl<'loan, 'buffers> QsaAttentionInputs<'loan, 'buffers> { pub fn new( diff --git a/crates/cuda-driver/src/qsa_prompt_attention/qsa_prompt_attention_drop.rs b/crates/cuda-driver/src/qsa_prompt_attention/qsa_prompt_attention_drop.rs index 57a7279f..2a72eee8 100644 --- a/crates/cuda-driver/src/qsa_prompt_attention/qsa_prompt_attention_drop.rs +++ b/crates/cuda-driver/src/qsa_prompt_attention/qsa_prompt_attention_drop.rs @@ -1,8 +1,7 @@ //! Methods of `QsaPromptAttentionCompletion`: `rows`, `with_output`, `into_values`. //! Implements `Drop for QsaPromptAttention`. Functions: `guard_grid`. -#[allow(unused_imports)] -use super::*; +use super::{DeviceBuffer, Error, QsaPromptAttention, QsaPromptAttentionCompletion, Result}; impl Drop for QsaPromptAttention<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/qsa_prompt_device.rs b/crates/cuda-driver/src/qsa_prompt_device.rs index b00d902e..1c8e3df6 100644 --- a/crates/cuda-driver/src/qsa_prompt_device.rs +++ b/crates/cuda-driver/src/qsa_prompt_device.rs @@ -1,6 +1,10 @@ //! Physical Original QSA prompt pipeline. Opaque selection retains the actual //! affine GR read and immutable completed index; no Buffer/address certificate. -use super::*; +use super::{ + A, ArenaRows, Arguments, CAP, Context, DECODE_POSTOPS, DeviceBuffer, Error, INDEX, IndexProgramSpans, Launch, + Module, NativeBatchWorkspace, POSTOPS, QsaIndexPrior, QsaPromptIndexState, QsaPromptIndexWorkspace, RESERVE, + Result, SELECT, combine, ffi, max_blocks, sizes, +}; use crate::original_prefill_arena::OriginalPromptSpan as S; use crate::original_prefill_layout::PrefillPhase; use crate::ple_batch_ffi::{BatchArg as B, KernelArguments, KernelModule}; diff --git a/crates/cuda-driver/src/qsa_prompt_device/context.rs b/crates/cuda-driver/src/qsa_prompt_device/context.rs index 06703317..2232faf6 100644 --- a/crates/cuda-driver/src/qsa_prompt_device/context.rs +++ b/crates/cuda-driver/src/qsa_prompt_device/context.rs @@ -1,8 +1,10 @@ //! Methods of `Context`: `original_qsa_prompt_device`. //! Functions: `native_block`, `native_entry`, `arena_span`, `common`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, OriginalDeviceGrRead, OriginalQsaPromptDevice, PrefillPhase, QsaNativeKind, QsaNativePacking, Result, S, + ffi, +}; impl<'ctx> Context<'ctx> { pub fn original_qsa_prompt_device( diff --git a/crates/cuda-driver/src/qsa_prompt_device/device_phases.rs b/crates/cuda-driver/src/qsa_prompt_device/device_phases.rs index 71e51f48..35a2c440 100644 --- a/crates/cuda-driver/src/qsa_prompt_device/device_phases.rs +++ b/crates/cuda-driver/src/qsa_prompt_device/device_phases.rs @@ -1,7 +1,12 @@ //! STRA-338 size: the phases of `OriginalQsaPromptDevice::{new, admit, prepare, close_inner}` and `complete`. -#[allow(unused_imports)] -use super::*; +use super::{ + CAP, Context, DECODE_POSTOPS, DeviceBuffer, Error, GATE_PTX, GATE_SHA, INDEX, KernelModule, Module, + NativeBatchWorkspace, OriginalDeviceGrRead, OriginalQsaDeviceSelection, OriginalQsaPromptDevice, + OriginalQsaPromptWeights, POSTOPS, ProjectionSpans, ProjectionWeight, QsaNativeKind, QsaNativePacking, + QsaPromptIndexWorkspace, RESERVE, Result, S, SCRATCH, SELECT, arena_span, combine, common, ffi, max_blocks, + native_block, sizes, +}; type Spans = Vec<(ffi::BufferHandle, usize)>; diff --git a/crates/cuda-driver/src/qsa_prompt_device/device_prepare.rs b/crates/cuda-driver/src/qsa_prompt_device/device_prepare.rs index ba28eb29..9f1531a0 100644 --- a/crates/cuda-driver/src/qsa_prompt_device/device_prepare.rs +++ b/crates/cuda-driver/src/qsa_prompt_device/device_prepare.rs @@ -3,7 +3,11 @@ #[allow(unused_imports)] use super::project_phases::{ProjectArgs, Projection}; -use super::*; +use super::{ + ArenaRows, Error, IndexProgramSpans, NativeBatchWorkspace, OriginalDeviceGrRead, OriginalQsaDeviceSelection, + OriginalQsaPromptDevice, OriginalQsaPromptWeights, ProjectionSpans, ProjectionWeight, QsaChunkPrior, QsaIndexPrior, + QsaNativePacking, Result, +}; impl<'ctx> OriginalQsaPromptDevice<'ctx> { /// One native projection of the chunk rows of `read` through `weight` (dequantized to F16 first when quantized). diff --git a/crates/cuda-driver/src/qsa_prompt_device/original_qsa_prompt_device.rs b/crates/cuda-driver/src/qsa_prompt_device/original_qsa_prompt_device.rs index f1dfb212..a5f8ce8c 100644 --- a/crates/cuda-driver/src/qsa_prompt_device/original_qsa_prompt_device.rs +++ b/crates/cuda-driver/src/qsa_prompt_device/original_qsa_prompt_device.rs @@ -3,7 +3,11 @@ #[allow(unused_imports)] use super::device_phases::{check_assets, index_for}; -use super::*; +use super::{ + Context, DeviceBuffer, Error, NativeBatchWorkspace, OriginalDeviceGrRead, OriginalQsaPromptDevice, + OriginalQsaPromptWeights, QsaNativePacking, QsaPromptIndexWorkspace, RESERVE, Result, SCRATCH, ffi, max_blocks, + sizes, +}; impl<'ctx> OriginalQsaPromptDevice<'ctx> { pub fn device_bytes(capacity: usize) -> Result { diff --git a/crates/cuda-driver/src/qsa_prompt_device/project_phases.rs b/crates/cuda-driver/src/qsa_prompt_device/project_phases.rs index f80310e5..61dd5310 100644 --- a/crates/cuda-driver/src/qsa_prompt_device/project_phases.rs +++ b/crates/cuda-driver/src/qsa_prompt_device/project_phases.rs @@ -1,7 +1,10 @@ //! STRA-338 size: the phases of `OriginalQsaPromptDevice::project` and `OriginalQsaDeviceSelection::complete`. -#[allow(unused_imports)] -use super::*; +use super::{ + A, Arguments, B, Error, KernelArguments, Launch, NativeBatchWorkspace, OriginalDeviceGrRead, + OriginalQsaPromptDevice, QsaNativeKind, Result, S, SCRATCH, arena_span, combine, common, ffi, native_block, + native_entry, +}; use crate::ple_batch_ffi::Blas; use crate::ple_batch_ffi::LinearLaunch; use crate::ple_batch_ffi::{GemmDims, GemmOperands, GemmScalars}; diff --git a/crates/cuda-driver/src/qsa_prompt_device/selection_completion.rs b/crates/cuda-driver/src/qsa_prompt_device/selection_completion.rs index 2059ff03..5a44c48f 100644 --- a/crates/cuda-driver/src/qsa_prompt_device/selection_completion.rs +++ b/crates/cuda-driver/src/qsa_prompt_device/selection_completion.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalQsaPromptDevice`: `close_inner`. //! Methods of `OriginalQsaDeviceSelection`: `rows`, `first_position`, `final_index`, `validate` and 3 more. -#[allow(unused_imports)] -use super::*; +use super::{ + CAP, CompletedQsaKvAppend, Context, Error, NativeBatchWorkspace, OriginalDeviceBlock, OriginalQsaDeviceSelection, + OriginalQsaPromptDevice, QsaAttendedKv, QsaKvAppendTarget, QsaNativeWeight, QsaPromptAttention, + QsaPromptIndexState, Result, arena_span, ffi, native_block, +}; impl<'ctx> OriginalQsaPromptDevice<'ctx> { pub(super) fn close_inner(&mut self) -> Result<()> { diff --git a/crates/cuda-driver/src/qsa_prompt_device_attention.rs b/crates/cuda-driver/src/qsa_prompt_device_attention.rs index 60ba0c0a..bb1f8b37 100644 --- a/crates/cuda-driver/src/qsa_prompt_device_attention.rs +++ b/crates/cuda-driver/src/qsa_prompt_device_attention.rs @@ -1,6 +1,6 @@ //! Same literal attention on the real selected query/IDs/steps/attn arena. use super::attention_kernel_plan_and_passes::AttnPasses; -use super::*; +use super::{Error, NativeBatchWorkspace, QsaAttendedKv, QsaPromptAttention, QsaPromptStage, Result}; impl<'ctx> QsaPromptAttention<'ctx> { pub(crate) fn attend_original_arena( &mut self, diff --git a/crates/cuda-driver/src/qsa_prompt_device_index.rs b/crates/cuda-driver/src/qsa_prompt_device_index.rs index 1140e039..1cbdfeee 100644 --- a/crates/cuda-driver/src/qsa_prompt_device_index.rs +++ b/crates/cuda-driver/src/qsa_prompt_device_index.rs @@ -1,6 +1,9 @@ //! Private real-arena continuation of the exact old prompt program. use super::run_phases::HostStaging; -use super::*; +use super::{ + ArenaRows, IndexProgramSpans, NativeBatchWorkspace, QsaIndexPrior, QsaPromptIndexState, QsaPromptIndexWorkspace, + Result, ffi, +}; impl<'ctx> QsaPromptIndexWorkspace<'ctx> { /// Runs the prompt (non-decode) index program over device rows that are already in the arena. pub(super) fn run_original_arena( diff --git a/crates/cuda-driver/src/qsa_prompt_device_kv.rs b/crates/cuda-driver/src/qsa_prompt_device_kv.rs index 4f520aa3..7b1a6fe0 100644 --- a/crates/cuda-driver/src/qsa_prompt_device_kv.rs +++ b/crates/cuda-driver/src/qsa_prompt_device_kv.rs @@ -1,5 +1,5 @@ //! Actual normalized K/V arena loans; original snapshot/quantize/readback unchanged. -use super::*; +use super::{CompletedQsaKvAppend, Error, NativeBatchWorkspace, QsaKvSnapshot, QsaPromptKv, QsaPromptStage, Result}; impl<'ctx> QsaPromptKv<'ctx> { pub(crate) fn append_original_arena( &mut self, diff --git a/crates/cuda-driver/src/qsa_prompt_index.rs b/crates/cuda-driver/src/qsa_prompt_index.rs index 8f3d0bf3..47b1838b 100644 --- a/crates/cuda-driver/src/qsa_prompt_index.rs +++ b/crates/cuda-driver/src/qsa_prompt_index.rs @@ -1,6 +1,9 @@ //! Closed literal Original prompt RMS/RoPE, three-launch index append and TC/radix selection. //! Output buffers are genuine exact-T owners, not fabricated active-prefix DeviceBuffers. -use super::*; +use super::{ + Context, CurrentGuard, DeviceBuffer, DeviceRef, Error, OriginalQsaMappedAppend, OriginalQsaMappedJournal, Result, + combine, ffi, +}; use crate::{ NativeBatchWorkspace, qsa_index_ffi::{Arg as A, Arguments, Launch, Module}, diff --git a/crates/cuda-driver/src/qsa_prompt_index/append_select.rs b/crates/cuda-driver/src/qsa_prompt_index/append_select.rs index 1982aa53..458eefc5 100644 --- a/crates/cuda-driver/src/qsa_prompt_index/append_select.rs +++ b/crates/cuda-driver/src/qsa_prompt_index/append_select.rs @@ -1,8 +1,10 @@ //! Methods of `QsaPromptIndexWorkspace`: `append_select_inner`, `check_select_inputs`, `select_bounds_ok`, `admit_ou... //! Functions: `release_outputs`, `select_lengths_ok`. Defines `Outputs`. -#[allow(unused_imports)] -use super::*; +use super::{ + CAP, DeviceBuffer, Error, IndexProgramSpans, NativeBatchWorkspace, QsaPromptIndexWorkspace, QsaPromptSelection, + RESERVE, Result, SelectRequest, ffi, +}; impl<'ctx> QsaPromptIndexWorkspace<'ctx> { pub(super) fn append_select_inner<'lease>( diff --git a/crates/cuda-driver/src/qsa_prompt_index/index_rows.rs b/crates/cuda-driver/src/qsa_prompt_index/index_rows.rs index b1503172..bd4bf73d 100644 --- a/crates/cuda-driver/src/qsa_prompt_index/index_rows.rs +++ b/crates/cuda-driver/src/qsa_prompt_index/index_rows.rs @@ -1,7 +1,7 @@ //! The row sets one QSA index append works on: the host image before it, the host rows it appends, the device rows of //! the arena path and the spans the index program writes. They replace long positional argument lists. -use super::*; +use super::ffi; /// The host image of the index before a chunk: the pooled block keys, the tail and the spare (`dead`) rows. #[derive(Clone, Copy)] diff --git a/crates/cuda-driver/src/qsa_prompt_index/index_run.rs b/crates/cuda-driver/src/qsa_prompt_index/index_run.rs index aef03474..75b21c95 100644 --- a/crates/cuda-driver/src/qsa_prompt_index/index_run.rs +++ b/crates/cuda-driver/src/qsa_prompt_index/index_run.rs @@ -2,8 +2,9 @@ //! Split out of `qsa_prompt_index` to keep its files under the line limit. use super::run_phases::{HostStaging, RunPlan}; -#[allow(unused_imports)] -use super::*; +use super::{ + IndexProgramSpans, NativeBatchWorkspace, QsaPromptIndexWorkspace, Result, SelectRequest, combine, encode, ffi, +}; impl<'ctx> QsaPromptIndexWorkspace<'ctx> { /// Uploads the prior image and the rows of `request`, runs the index program over them and checks the status diff --git a/crates/cuda-driver/src/qsa_prompt_index/max_blocks.rs b/crates/cuda-driver/src/qsa_prompt_index/max_blocks.rs index 5be4a779..b009dce6 100644 --- a/crates/cuda-driver/src/qsa_prompt_index/max_blocks.rs +++ b/crates/cuda-driver/src/qsa_prompt_index/max_blocks.rs @@ -1,8 +1,7 @@ //! Methods of `Context`: `qsa_prompt_index_workspace`, `qsa_prompt_index_workspace_for_capacity`. //! Functions: `max_blocks`, `sizes`, `encode`. -#[allow(unused_imports)] -use super::*; +use super::{Context, Error, QsaPromptIndexWorkspace, Result}; /// Score row stride (blocks plus tail and spare) of the configured serving context: `65538` at 262144 cells. pub(super) fn max_blocks() -> usize { diff --git a/crates/cuda-driver/src/qsa_prompt_index/qsa_prompt_index_read_and_close.rs b/crates/cuda-driver/src/qsa_prompt_index/qsa_prompt_index_read_and_close.rs index 5ecffdcf..5d1c6d7f 100644 --- a/crates/cuda-driver/src/qsa_prompt_index/qsa_prompt_index_read_and_close.rs +++ b/crates/cuda-driver/src/qsa_prompt_index/qsa_prompt_index_read_and_close.rs @@ -1,8 +1,10 @@ //! Methods of `QsaPromptIndexWorkspace`: `read`, `final_state`, `final_state_with`, `read_finite` and 3 more. //! Methods of `QsaPromptIndexPrefix`: `end_position`, `pooled`, `tail`, `dead`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, QsaPromptIndexPrefix, QsaPromptIndexState, QsaPromptIndexWorkspace, + QsaPromptSelection, Result, combine, ffi, +}; impl<'ctx> QsaPromptIndexWorkspace<'ctx> { pub(super) fn read(&mut self, h: ffi::BufferHandle, n: usize) -> Result> { diff --git a/crates/cuda-driver/src/qsa_prompt_index/qsa_prompt_index_workspace.rs b/crates/cuda-driver/src/qsa_prompt_index/qsa_prompt_index_workspace.rs index ed1aa959..63954029 100644 --- a/crates/cuda-driver/src/qsa_prompt_index/qsa_prompt_index_workspace.rs +++ b/crates/cuda-driver/src/qsa_prompt_index/qsa_prompt_index_workspace.rs @@ -1,8 +1,11 @@ //! Methods of `QsaPromptIndexWorkspace`: `new`, `new_capacity`, `init_resources`, `prompt_device_bytes` and 11 more. //! Functions: `capacity_sizes`, `check_assets_sealed`, `check_peak_budget`. -#[allow(unused_imports)] -use super::*; +use super::{ + CAP, Context, DECODE_POSTOPS, DeviceBuffer, Error, INDEX, Module, NativeBatchWorkspace, POSTOPS, QsaChunkRows, + QsaIndexPrior, QsaPromptIndexWorkspace, QsaPromptSelection, RESERVE, Result, SELECT, SelectRequest, encode, ffi, + max_blocks, sizes, +}; impl<'ctx> QsaPromptIndexWorkspace<'ctx> { pub(super) fn new(context: &'ctx Context<'ctx>) -> Result { diff --git a/crates/cuda-driver/src/qsa_prompt_index/run_launches.rs b/crates/cuda-driver/src/qsa_prompt_index/run_launches.rs index d2a46249..4cf2eadd 100644 --- a/crates/cuda-driver/src/qsa_prompt_index/run_launches.rs +++ b/crates/cuda-driver/src/qsa_prompt_index/run_launches.rs @@ -1,8 +1,7 @@ //! STRA-338 size: the launch builders of `QsaPromptIndexWorkspace::run`, one function per phase. use super::run_phases::{Commands, RunPlan, push_launch}; -#[allow(unused_imports)] -use super::*; +use super::{A, CAP, Launch, QsaPromptIndexWorkspace, Result, ffi, max_blocks}; struct ScoreTile { count: usize, diff --git a/crates/cuda-driver/src/qsa_prompt_index/run_phases.rs b/crates/cuda-driver/src/qsa_prompt_index/run_phases.rs index 5b46b212..42cc86e4 100644 --- a/crates/cuda-driver/src/qsa_prompt_index/run_phases.rs +++ b/crates/cuda-driver/src/qsa_prompt_index/run_phases.rs @@ -1,8 +1,10 @@ //! STRA-338 size: the phases of `QsaPromptIndexWorkspace::run`, extracted without reordering any call. use super::run_launches::{push_norm_rope, push_scan}; -#[allow(unused_imports)] -use super::*; +use super::{ + A, Arguments, CAP, Error, IndexProgramSpans, Launch, NativeBatchWorkspace, QsaChunkRows, QsaIndexPrior, + QsaPromptIndexWorkspace, Result, encode, ffi, +}; use crate::ple_batch_ffi::Blas; pub(super) type Commands = Vec<(Launch, Arguments)>; diff --git a/crates/cuda-driver/src/qsa_prompt_kv/offsets.rs b/crates/cuda-driver/src/qsa_prompt_kv/offsets.rs index def68e21..22c0b2f4 100644 --- a/crates/cuda-driver/src/qsa_prompt_kv/offsets.rs +++ b/crates/cuda-driver/src/qsa_prompt_kv/offsets.rs @@ -1,8 +1,10 @@ //! Methods of `QsaKvInputs`: `new`. Methods of `QsaKvOwnerId`: `same_owner`. //! Functions: `offsets`, `stage_runs`, `resident_runs`, `page_payload_eq` and 3 more. -#[allow(unused_imports)] -use super::*; +use super::{ + CompletedQsaKvAppend, Context, DeviceBuffer, Error, Origin, Page, Pools, QSA_PROMPT_HOST_PAGE_BYTES, QsaKvInputs, + QsaKvOwnerId, QsaKvSnapshot, QsaPromptKv, QsaPromptStage, RESERVE, Rc, Result, Snapshot, combine, geometry, +}; /// Run offsets inside the mapped allocation for the configured context. pub(super) fn offsets() -> Result<[usize; 4]> { diff --git a/crates/cuda-driver/src/qsa_prompt_kv/qsa_prompt_kv_drop.rs b/crates/cuda-driver/src/qsa_prompt_kv/qsa_prompt_kv_drop.rs index 02102f60..e9bd652b 100644 --- a/crates/cuda-driver/src/qsa_prompt_kv/qsa_prompt_kv_drop.rs +++ b/crates/cuda-driver/src/qsa_prompt_kv/qsa_prompt_kv_drop.rs @@ -1,8 +1,11 @@ //! Methods of `QsaPromptStage`: `new`, `allocate_all`, `allocated_bytes`, `is_failed` and 11 more. //! Implements `Drop for QsaPromptKv`, `Drop for QsaPromptStage`. Functions: `read_range`. -#[allow(unused_imports)] -use super::*; +use super::{ + Arguments, Context, DeviceBuffer, Error, LaunchGeometry, NativeBatchWorkspace, PAGE, Pools, QsaKvSnapshot, + QsaPromptKv, QsaPromptStage, RESERVE, Rc, Result, Snapshot, admit, bytes_i32, checked, combine, geometry, + stage_runs, +}; impl Drop for QsaPromptKv<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/qsa_prompt_kv/staged_append.rs b/crates/cuda-driver/src/qsa_prompt_kv/staged_append.rs index 00537e57..a9e7b739 100644 --- a/crates/cuda-driver/src/qsa_prompt_kv/staged_append.rs +++ b/crates/cuda-driver/src/qsa_prompt_kv/staged_append.rs @@ -1,8 +1,12 @@ //! Defines `StagedAppend`. //! Split out of `qsa_prompt_kv` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, CompletedQsaKvAppend, Context, DeviceBuffer, Error, LaunchGeometry, MappedAllocation, + NativeBatchWorkspace, Origin, PAGE, Page, PoolAddresses, Pools, QsaKvInputs, QsaKvOwnerId, QsaKvSnapshot, + QsaPromptKv, QsaPromptStage, RESERVE, Rc, Resolver, Result, SelectedRows, Snapshot, admit, checked, combine, + geometry, offsets, read_range, resident_runs, stage_runs, +}; /// The stage one bounded append runs on and the snapshot it extends. pub(super) struct StagedAppend<'a, 'ctx> { diff --git a/crates/cuda-driver/src/qsa_prompt_kv/staged_append/append_phases.rs b/crates/cuda-driver/src/qsa_prompt_kv/staged_append/append_phases.rs index d4e09e6d..1e2ed821 100644 --- a/crates/cuda-driver/src/qsa_prompt_kv/staged_append/append_phases.rs +++ b/crates/cuda-driver/src/qsa_prompt_kv/staged_append/append_phases.rs @@ -1,7 +1,9 @@ //! STRA-338 size: the phases of `QsaPromptKv::append_bounded`, extracted in call order. -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Arguments, CompletedQsaKvAppend, DeviceBuffer, Error, LaunchGeometry, NativeBatchWorkspace, PAGE, Page, + QsaKvSnapshot, QsaPromptKv, QsaPromptStage, Rc, Result, Snapshot, checked, geometry, read_range, +}; type Completed = Vec>>; diff --git a/crates/cuda-driver/src/qsa_prompt_kv/staged_append/qsa_prompt_kv_append_bounded_close.rs b/crates/cuda-driver/src/qsa_prompt_kv/staged_append/qsa_prompt_kv_append_bounded_close.rs index 08a70dfa..6e500c56 100644 --- a/crates/cuda-driver/src/qsa_prompt_kv/staged_append/qsa_prompt_kv_append_bounded_close.rs +++ b/crates/cuda-driver/src/qsa_prompt_kv/staged_append/qsa_prompt_kv_append_bounded_close.rs @@ -1,8 +1,10 @@ //! Methods of `QsaPromptKv`: `append_bounded`, `close`, `close_inner`, `close_mapped` and 1 more. //! Split out of `staged_append` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + CompletedQsaKvAppend, Error, MappedAllocation, NativeBatchWorkspace, QsaKvInputs, QsaPromptKv, Result, + StagedAppend, combine, +}; impl<'ctx> QsaPromptKv<'ctx> { /// Appends `inputs` (at most `limit` rows) after `staged.prior` through `staged.stage`. diff --git a/crates/cuda-driver/src/qsa_prompt_kv/staged_append/qsa_prompt_kv_bring_up.rs b/crates/cuda-driver/src/qsa_prompt_kv/staged_append/qsa_prompt_kv_bring_up.rs index 3e4fe81f..2f84694f 100644 --- a/crates/cuda-driver/src/qsa_prompt_kv/staged_append/qsa_prompt_kv_bring_up.rs +++ b/crates/cuda-driver/src/qsa_prompt_kv/staged_append/qsa_prompt_kv_bring_up.rs @@ -1,8 +1,12 @@ //! Methods of `QsaPromptKv`: `new`, `init_resources`, `map_host`, `empty_snapshot` and 16 more. //! Functions: `check_host_memory`. -#[allow(unused_imports)] -use super::*; +use super::{ + CompletedQsaKvAppend, Context, DeviceBuffer, Error, MappedAllocation, NativeBatchWorkspace, Origin, PAGE, + PoolAddresses, Pools, QsaKvInputs, QsaKvOwnerId, QsaKvSnapshot, QsaPromptKv, QsaPromptStage, RESERVE, Rc, Resolver, + Result, SelectedRows, Snapshot, StagedAppend, admit, checked, combine, geometry, offsets, resident_runs, + stage_runs, +}; impl<'ctx> QsaPromptKv<'ctx> { pub(in super::super) fn new(c: &'ctx Context<'ctx>) -> Result { diff --git a/crates/cuda-driver/src/qsa_resident_attention.rs b/crates/cuda-driver/src/qsa_resident_attention.rs index a30a00a5..e8313eb4 100644 --- a/crates/cuda-driver/src/qsa_resident_attention.rs +++ b/crates/cuda-driver/src/qsa_resident_attention.rs @@ -1,6 +1,9 @@ //! Same literal attention on the real selected query/IDs/steps/attn arena. use super::attention_kernel_plan_and_passes::{AttnPasses, KernelEntry, admit_budget}; -use super::*; +use super::{ + Arguments, Context, Error, LaunchGeometry, Module, NativeBatchWorkspace, QsaPromptAttention, Result, + SelectSwitches, checked, combine, +}; /// The resident prompt KV one attention pass reads: the transport stage, the mapped journal and the prefix fixing its /// extent. They travel together because the attention addresses the pools through all three. pub(crate) struct OriginalQsaAttendedKv<'a, 'ctx> { diff --git a/crates/cuda-driver/src/qsa_resident_decode.rs b/crates/cuda-driver/src/qsa_resident_decode.rs index 7ef6e21b..704041e6 100644 --- a/crates/cuda-driver/src/qsa_resident_decode.rs +++ b/crates/cuda-driver/src/qsa_resident_decode.rs @@ -1,6 +1,6 @@ //! Literal native decode attention over the real resident mapped journal. //! No page restore, no host snapshot/image. Full scans and actual clock remain. -use super::*; +use super::{DeviceBuffer, Error, NativeBatchWorkspace, QsaAttentionInputs, QsaNativeDecode, Result}; use crate::qsa_prompt_kv::{OriginalQsaMappedJournal, OriginalQsaMappedPrefix}; pub struct OriginalQsaResidentDecodeCompletion<'loan, 'ctx> { owner: &'loan mut QsaNativeDecode<'ctx>, diff --git a/crates/cuda-driver/src/qsa_resident_device.rs b/crates/cuda-driver/src/qsa_resident_device.rs index 572805ca..44ee17ea 100644 --- a/crates/cuda-driver/src/qsa_resident_device.rs +++ b/crates/cuda-driver/src/qsa_resident_device.rs @@ -1,5 +1,11 @@ //! Real-arena resident continuation. No host state image or fake pending state. -use super::*; +use super::{ + ArenaRows, B, CAP, Context, DECODE_POSTOPS, DeviceBuffer, Error, GATE_PTX, GATE_SHA, INDEX, IndexProgramSpans, + KernelArguments, KernelModule, Module, NativeBatchWorkspace, OriginalDeviceBlock, OriginalDeviceGrRead, + OriginalQsaPromptDevice, OriginalQsaPromptWeights, POSTOPS, PrefillPhase, ProjectionSpans, ProjectionWeight, + QsaNativePacking, QsaNativeWeight, QsaPromptIndexWorkspace, RESERVE, Result, S, SCRATCH, SELECT, arena_span, + combine, common, ffi, max_blocks, native_block, sizes, +}; use crate::qsa_prompt_index::{ OriginalQsaIndexBatch, OriginalQsaIndexCheckpoint, OriginalQsaResidentIndex, ResidentContinuation, }; diff --git a/crates/cuda-driver/src/qsa_resident_device/original_qsa_prompt_device.rs b/crates/cuda-driver/src/qsa_resident_device/original_qsa_prompt_device.rs index f7ab5a68..1bb8e191 100644 --- a/crates/cuda-driver/src/qsa_resident_device/original_qsa_prompt_device.rs +++ b/crates/cuda-driver/src/qsa_resident_device/original_qsa_prompt_device.rs @@ -1,8 +1,12 @@ //! Methods of `ResidentJob`: `run_index`. //! Methods of `OriginalQsaPromptDevice`: `prepare_resident`, `resident_bounds`, `check_resident_idle`, `admit_budget... -#[allow(unused_imports)] -use super::*; +use super::{ + ArenaRows, CAP, Context, DeviceBuffer, Error, IndexProgramSpans, NativeBatchWorkspace, OriginalDeviceGrRead, + OriginalQsaIndexBatch, OriginalQsaIndexCheckpoint, OriginalQsaPromptDevice, OriginalQsaPromptWeights, + OriginalQsaResidentIndex, OriginalQsaResidentSelection, PrefillPhase, ProjectionSpans, ProjectionWeight, + QsaPromptIndexWorkspace, RESERVE, ResidentContinuation, Result, S, arena_span, combine, common, ffi, +}; /// The spans the resident index program reads and writes for one chunk. struct ResidentSpans { diff --git a/crates/cuda-driver/src/qsa_resident_device/qsa_prompt_device_resident_bring_up.rs b/crates/cuda-driver/src/qsa_resident_device/qsa_prompt_device_resident_bring_up.rs index 38e6e1fe..4e7c19c0 100644 --- a/crates/cuda-driver/src/qsa_resident_device/qsa_prompt_device_resident_bring_up.rs +++ b/crates/cuda-driver/src/qsa_resident_device/qsa_prompt_device_resident_bring_up.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalQsaPromptDevice`: `new_resident`, `unloaded`, `init_resident`, `allocate_resident` and 2 more. //! Functions: `check_sealed`, `resident_sizes`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DECODE_POSTOPS, Error, GATE_PTX, GATE_SHA, INDEX, KernelModule, Module, OriginalQsaPromptDevice, + OriginalQsaResidentPromptDevice, POSTOPS, QsaNativePacking, QsaPromptIndexWorkspace, RESERVE, Result, SCRATCH, + SELECT, combine, max_blocks, sizes, +}; /// The sealed kernels must be the pinned ones. fn check_sealed() -> Result<()> { diff --git a/crates/cuda-driver/src/qsa_resident_device/qsa_resident_prompt_device_prepare.rs b/crates/cuda-driver/src/qsa_resident_device/qsa_resident_prompt_device_prepare.rs index 6c18364a..8280411d 100644 --- a/crates/cuda-driver/src/qsa_resident_device/qsa_resident_prompt_device_prepare.rs +++ b/crates/cuda-driver/src/qsa_resident_device/qsa_resident_prompt_device_prepare.rs @@ -2,8 +2,13 @@ //! Methods of `Context`: `original_qsa_resident_prompt_device`. use super::original_qsa_prompt_device::lap; -#[allow(unused_imports)] -use super::*; +use super::{ + B, Context, Error, KernelArguments, NativeBatchWorkspace, OriginalDeviceBlock, OriginalDeviceGrRead, + OriginalQsaIndexBatch, OriginalQsaIndexCheckpoint, OriginalQsaMappedAppend, OriginalQsaMappedJournal, + OriginalQsaMappedPrefix, OriginalQsaPromptDevice, OriginalQsaPromptWeights, OriginalQsaResidentAppendTarget, + OriginalQsaResidentPromptDevice, OriginalQsaResidentSelection, ProjectionSpans, ProjectionWeight, QsaNativePacking, + QsaNativeWeight, ResidentContinuation, Result, S, arena_span, combine, common, ffi, native_block, sizes, +}; use crate::ple_batch_ffi::LinearLaunch; use crate::qsa_prompt_attention::OriginalQsaAttendedKv; diff --git a/crates/cuda-driver/src/qsa_resident_index.rs b/crates/cuda-driver/src/qsa_resident_index.rs index a4014dba..a6a4fad4 100644 --- a/crates/cuda-driver/src/qsa_resident_index.rs +++ b/crates/cuda-driver/src/qsa_resident_index.rs @@ -1,7 +1,12 @@ //! Live Original index image. Only actual checkpoint copies and accepted-key //! replay create prefix authority; a final image cannot be relabelled earlier. use super::resident_transfer::Transfer; -use super::*; +use super::{ + Context, DeviceBuffer, Error, NativeBatchWorkspace, QsaPromptIndexWorkspace, RESERVE, Result, combine, ffi, sizes, +}; +// used only with some cargo features or targets of this crate +#[allow(unused_imports)] +use super::{DeviceRef, OriginalQsaMappedAppend, OriginalQsaMappedJournal}; use std::{ cell::{Cell, RefCell}, rc::{Rc, Weak}, diff --git a/crates/cuda-driver/src/qsa_resident_index/image_bytes.rs b/crates/cuda-driver/src/qsa_resident_index/image_bytes.rs index d6dfc3bc..f41b5adc 100644 --- a/crates/cuda-driver/src/qsa_resident_index/image_bytes.rs +++ b/crates/cuda-driver/src/qsa_resident_index/image_bytes.rs @@ -1,8 +1,10 @@ //! Methods of `OriginalQsaIndexCheckpoint`: `next_position`, `device_bytes`, `validate_retained`. //! Methods of `Context`: `original_qsa_resident_index`. Implements `Drop for Saved`. Functions: `image_bytes`. -#[allow(unused_imports)] -use super::*; +use super::{ + CHECKPOINT_BYTES, Context, DeviceBuffer, Error, OriginalQsaIndexCheckpoint, OriginalQsaResidentIndex, POOLED, + Result, Saved, sizes, +}; pub(super) fn image_bytes() -> usize { sizes()[0] + 1536 + 512 + 4 diff --git a/crates/cuda-driver/src/qsa_resident_index/original_qsa_index_batch.rs b/crates/cuda-driver/src/qsa_resident_index/original_qsa_index_batch.rs index 482d50bb..afb3d7a5 100644 --- a/crates/cuda-driver/src/qsa_resident_index/original_qsa_index_batch.rs +++ b/crates/cuda-driver/src/qsa_resident_index/original_qsa_index_batch.rs @@ -1,8 +1,9 @@ //! Methods of `OriginalQsaIndexBatch`: `first_position`, `rows`, `commit_prefix`, `publish` and 2 more. //! Implements `Drop for OriginalQsaIndexBatch`. -#[allow(unused_imports)] -use super::*; +use super::{ + Error, NativeBatchWorkspace, OriginalQsaIndexBatch, OriginalQsaIndexCheckpoint, QsaPromptIndexWorkspace, Result, +}; impl<'index, 'weights, 'ctx> OriginalQsaIndexBatch<'index, 'weights, 'ctx> { pub fn first_position(&self) -> usize { diff --git a/crates/cuda-driver/src/qsa_resident_index/original_qsa_resident_index.rs b/crates/cuda-driver/src/qsa_resident_index/original_qsa_resident_index.rs index 2cdcb428..5276a421 100644 --- a/crates/cuda-driver/src/qsa_resident_index/original_qsa_resident_index.rs +++ b/crates/cuda-driver/src/qsa_resident_index/original_qsa_resident_index.rs @@ -1,8 +1,11 @@ //! Methods of `OriginalQsaResidentIndex`: `device_bytes`, `new`, `empty`, `init_image` and 19 more. //! Functions: `poison_unless_host_allocation`. -#[allow(unused_imports)] -use super::*; +use super::{ + CHECKPOINT_BYTES, Cell, Context, Coverage, DeviceBuffer, Error, NativeBatchWorkspace, Origin, + OriginalQsaIndexCheckpoint, OriginalQsaResidentIndex, RESERVE, Rc, RefCell, Result, Saved, Transfer, combine, ffi, + image_bytes, sizes, +}; impl<'ctx> OriginalQsaResidentIndex<'ctx> { pub fn device_bytes() -> usize { diff --git a/crates/cuda-driver/src/qsa_resident_index/qsa_resident_index_checkpoint_restore.rs b/crates/cuda-driver/src/qsa_resident_index/qsa_resident_index_checkpoint_restore.rs index 419e2557..9377a905 100644 --- a/crates/cuda-driver/src/qsa_resident_index/qsa_resident_index_checkpoint_restore.rs +++ b/crates/cuda-driver/src/qsa_resident_index/qsa_resident_index_checkpoint_restore.rs @@ -2,8 +2,10 @@ //! Implements `Drop for Placement`, `Drop for OriginalQsaResidentIndex`. Defines `Placement`. use super::original_qsa_resident_index::poison_unless_host_allocation; -#[allow(unused_imports)] -use super::*; +use super::{ + CHECKPOINT_BYTES, Cell, Coverage, DeviceBuffer, Error, NativeBatchWorkspace, OriginalQsaIndexCheckpoint, + OriginalQsaResidentIndex, QsaPromptIndexWorkspace, Rc, Result, Saved, combine, sizes, +}; /// The resident image swapped into a prompt-index workspace for the length of a run; dropping it swaps both back. struct Placement<'a, 'ctx> { diff --git a/crates/cuda-driver/src/qsa_resident_index_program.rs b/crates/cuda-driver/src/qsa_resident_index_program.rs index d391ecf4..81e725d7 100644 --- a/crates/cuda-driver/src/qsa_resident_index_program.rs +++ b/crates/cuda-driver/src/qsa_resident_index_program.rs @@ -1,6 +1,9 @@ //! Same literal index program over real resident image; no prior upload, //! host final image, raw FP16 round, or selected-ID payload readback. -use super::*; +use super::{ + A, ArenaRows, Arguments, CAP, CurrentGuard, DeviceBuffer, Error, IndexProgramSpans, Launch, NativeBatchWorkspace, + QsaPromptIndexWorkspace, Result, combine, ffi, max_blocks, +}; #[path = "qsa_resident_index_program/arena_plan.rs"] mod arena_plan; diff --git a/crates/cuda-driver/src/qsa_resident_index_program/arena_plan.rs b/crates/cuda-driver/src/qsa_resident_index_program/arena_plan.rs index 4c34a5f7..2947b04a 100644 --- a/crates/cuda-driver/src/qsa_resident_index_program/arena_plan.rs +++ b/crates/cuda-driver/src/qsa_resident_index_program/arena_plan.rs @@ -1,8 +1,7 @@ //! Launch plan of `run_resident_arena` (STRA-338): the program is recorded here in the order of the former single //! function; the submission and the checks stay in `qsa_prompt_index_workspace.rs`. -#[allow(unused_imports)] -use super::*; +use super::{A, Arguments, CAP, Error, Launch, QsaPromptIndexWorkspace, Result, ffi, max_blocks}; /// A launch of `qsa_late.cu`: (position in `commands` it runs before, grid, entry, block, arguments). pub(super) type LateLaunch = (usize, u32, usize, u32, crate::ple_batch_ffi::KernelArguments); diff --git a/crates/cuda-driver/src/qsa_resident_index_program/prefix_replay.rs b/crates/cuda-driver/src/qsa_resident_index_program/prefix_replay.rs index ce76e572..301ef25b 100644 --- a/crates/cuda-driver/src/qsa_resident_index_program/prefix_replay.rs +++ b/crates/cuda-driver/src/qsa_resident_index_program/prefix_replay.rs @@ -1,8 +1,9 @@ //! Methods of `QsaPromptIndexWorkspace`: `replay_resident_prefix`, `replay_handles`, `upload_steps`, `check_replay` ... //! Functions: `replay_steps`, `replay_commands`, `replay_append`, `launch_label` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{ + A, Arguments, CAP, DeviceBuffer, Error, Launch, NativeBatchWorkspace, QsaPromptIndexWorkspace, Result, combine, ffi, +}; /// The device spans one accepted-prefix replay reads and writes. struct ReplayIo { diff --git a/crates/cuda-driver/src/qsa_resident_index_program/qsa_prompt_index_workspace.rs b/crates/cuda-driver/src/qsa_resident_index_program/qsa_prompt_index_workspace.rs index b46d354e..46a62e85 100644 --- a/crates/cuda-driver/src/qsa_resident_index_program/qsa_prompt_index_workspace.rs +++ b/crates/cuda-driver/src/qsa_resident_index_program/qsa_prompt_index_workspace.rs @@ -1,8 +1,10 @@ //! Methods of `QsaPromptIndexWorkspace`: `run_resident_arena`, `run_arena`, `submit_arena`, `arena_steps` and 7 more. //! Functions: `late_label`. -#[allow(unused_imports)] -use super::*; +use super::{ + ArenaCall, ArenaIo, ArenaPlan, ArenaRows, CAP, CurrentGuard, Error, IndexProgramSpans, LateQueue, + NativeBatchWorkspace, QsaPromptIndexWorkspace, Result, combine, launch_label, +}; use crate::ple_batch_ffi::LinearLaunch; impl<'ctx> QsaPromptIndexWorkspace<'ctx> { diff --git a/crates/cuda-driver/src/qsa_resident_scalar_index.rs b/crates/cuda-driver/src/qsa_resident_scalar_index.rs index 7568e7c7..01c0921b 100644 --- a/crates/cuda-driver/src/qsa_resident_scalar_index.rs +++ b/crates/cuda-driver/src/qsa_resident_scalar_index.rs @@ -1,6 +1,10 @@ //! Literal T1 native append/FP32 decode scores over the actual live index. //! Host scalar projection inputs are genuine inputs, never prior-state images. -use super::*; +use super::{ + ArenaRows, CAP, Context, DECODE_POSTOPS, DeviceBuffer, Error, INDEX, IndexProgramSpans, Module, + NativeBatchWorkspace, OriginalQsaIndexBatch, OriginalQsaIndexCheckpoint, OriginalQsaResidentIndex, POSTOPS, + QsaPromptIndexWorkspace, RESERVE, ResidentContinuation, Result, SELECT, combine, encode, ffi, max_blocks, sizes, +}; type Outputs<'ctx> = [Option>; 5]; pub struct OriginalQsaResidentScalarIndex<'ctx> { workspace: QsaPromptIndexWorkspace<'ctx>, diff --git a/crates/cuda-driver/src/qsa_resident_transfer/enabled.rs b/crates/cuda-driver/src/qsa_resident_transfer/enabled.rs index 5e8e8e42..bf474157 100644 --- a/crates/cuda-driver/src/qsa_resident_transfer/enabled.rs +++ b/crates/cuda-driver/src/qsa_resident_transfer/enabled.rs @@ -1,7 +1,7 @@ //! Methods of `Transfer`: `new`, `can_overlap`, `is_pending`, `begin` and 8 more. Implements `Drop for Transfer`. //! Functions: `driver_code`, `poison_failed`, `check_ranges`, `load_side`. -use super::*; +use super::{Context, Error, NativeBatchWorkspace, Result, combine}; use std::ffi::c_void; type Copy = unsafe extern "C" fn(u64, u64, usize, *mut c_void) -> i32; type StreamCreate = unsafe extern "C" fn(*mut *mut c_void, u32) -> i32; diff --git a/crates/cuda-driver/src/qsa_resident_transport.rs b/crates/cuda-driver/src/qsa_resident_transport.rs index 69e1bd90..ad25eb77 100644 --- a/crates/cuda-driver/src/qsa_resident_transport.rs +++ b/crates/cuda-driver/src/qsa_resident_transport.rs @@ -1,6 +1,9 @@ //! Original prompt KV staging uses actual cache-tail arena spans. Only the //! fixed module/status/identity table are owned here; no second full KV bank. -use super::*; +use super::{ + Arguments, Context, DeviceBuffer, Error, LaunchGeometry, Module, NativeBatchWorkspace, RESERVE, Result, admit, + bytes_i32, checked, combine, +}; pub struct OriginalQsaResidentTransport<'ctx> { context: &'ctx Context<'ctx>, table: Option>, diff --git a/crates/cuda-driver/src/qsa_selected_kv.rs b/crates/cuda-driver/src/qsa_selected_kv.rs index 97573390..9740adcb 100644 --- a/crates/cuda-driver/src/qsa_selected_kv.rs +++ b/crates/cuda-driver/src/qsa_selected_kv.rs @@ -1,5 +1,7 @@ //! Fixed lossless byte transport. Runtime, not this driver, authenticates page provenance. -use super::*; +use super::{Cell, Context, DeviceBuffer, Error, Rc, Result, combine, ffi}; +#[cfg(test)] +use super::{Device, Driver}; use crate::qwen_ffi::{self, Operation}; const CELLS: usize = 2051; diff --git a/crates/cuda-driver/src/qsa_selected_kv/asset.rs b/crates/cuda-driver/src/qsa_selected_kv/asset.rs index 9fbf29d6..70ad36a6 100644 --- a/crates/cuda-driver/src/qsa_selected_kv/asset.rs +++ b/crates/cuda-driver/src/qsa_selected_kv/asset.rs @@ -1,8 +1,7 @@ //! Methods of `Context`: `qsa_selected_kv_workspace`. Functions: `asset`. //! Split out of `qsa_selected_kv` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, Error, PTX, PTX_BYTES, PTX_SHA, QsaSelectedKvWorkspace, Result, qwen_ffi}; pub(crate) fn asset() -> Result<&'static [u8]> { let digest = PTX_SHA.ok_or(Error::UnsupportedQwenOperation)?; diff --git a/crates/cuda-driver/src/qsa_selected_kv/qsa_selected_kv_attend_io.rs b/crates/cuda-driver/src/qsa_selected_kv/qsa_selected_kv_attend_io.rs index ac10692e..b3223efd 100644 --- a/crates/cuda-driver/src/qsa_selected_kv/qsa_selected_kv_attend_io.rs +++ b/crates/cuda-driver/src/qsa_selected_kv/qsa_selected_kv_attend_io.rs @@ -1,8 +1,10 @@ //! Methods of `QsaSelectedKvProducts`: `width`, `generation`, `attend`. //! Methods of `QsaSelectedKvWorkspace`: `attend_io`, `check_attend_buffers`, `launch_attend`. -#[allow(unused_imports)] -use super::*; +use super::{ + CELL, DeviceBuffer, Error, Operation, PACKED, QsaSelectedKvProducts, QsaSelectedKvWorkspace, Result, SIZES, + combine, ffi, qwen_ffi, +}; impl Drop for QsaSelectedKvWorkspace<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/qsa_selected_kv/qsa_selected_kv_workspace.rs b/crates/cuda-driver/src/qsa_selected_kv/qsa_selected_kv_workspace.rs index b1857b8a..b70987e8 100644 --- a/crates/cuda-driver/src/qsa_selected_kv/qsa_selected_kv_workspace.rs +++ b/crates/cuda-driver/src/qsa_selected_kv/qsa_selected_kv_workspace.rs @@ -1,8 +1,11 @@ //! Methods of `QsaSelectedKvWorkspace`: `new`, `admit_new`, `load`, `load_modules` and 12 more. //! Functions: `check_shapes`, `check_finite`, `release_buffer`, `unload_module`. Defines `SelectedLaunch`. -#[allow(unused_imports)] -use super::*; +use super::{ + CELL, CELLS, Cell, Context, DeviceBuffer, Error, LAYERS, MAP, Operation, PACKED, QsaKvMisses, + QsaSelectedKvProducts, QsaSelectedKvWorkspace, RESERVE, Rc, Result, SIZES, TOTAL, asset, combine, ffi, owned_bytes, + qwen_ffi, slot_bytes, +}; /// The staged host bytes, arguments and device targets of one `prepare` launch window. struct SelectedLaunch { diff --git a/crates/cuda-driver/src/qsa_verification_commit.rs b/crates/cuda-driver/src/qsa_verification_commit.rs index 49030478..84790efd 100644 --- a/crates/cuda-driver/src/qsa_verification_commit.rs +++ b/crates/cuda-driver/src/qsa_verification_commit.rs @@ -1,7 +1,10 @@ //! Literal Verifier QSA commit over the ACTUAL twelve resident index images. //! Owns those images; it never constructs an earlier checkpoint from final data. //! Child of qsa_resident_index. All graph aggregates retain this same Rc journal. -use super::*; +use super::{ + Cell, Context, Coverage, DeviceBuffer, DeviceRef, Error, NativeBatchWorkspace, OriginalQsaIndexCheckpoint, + OriginalQsaMappedAppend, OriginalQsaMappedJournal, OriginalQsaResidentIndex, Rc, Result, +}; use crate::OriginalCapture; use crate::original_verify::abi::{Arg, Command}; use crate::original_verify::{OriginalVerifyBank, OriginalVerifyGdnJournal}; diff --git a/crates/cuda-driver/src/qsa_verification_commit/original_verify_qsa_journal.rs b/crates/cuda-driver/src/qsa_verification_commit/original_verify_qsa_journal.rs index 50a6fa54..9b4e0867 100644 --- a/crates/cuda-driver/src/qsa_verification_commit/original_verify_qsa_journal.rs +++ b/crates/cuda-driver/src/qsa_verification_commit/original_verify_qsa_journal.rs @@ -3,7 +3,12 @@ #[allow(unused_imports)] use super::verify_qsa_journal_loan::print_of; -use super::*; +use super::{ + Arg, Cell, Command, Context, DeviceBuffer, DeviceRef, Error, Live, NativeBatchWorkspace, OriginalCapture, + OriginalQsaIndexCheckpoint, OriginalQsaMappedJournal, OriginalQsaResidentIndex, OriginalVerifyBank, + OriginalVerifyGdnJournal, OriginalVerifyQsaJournal, OriginalVerifyQsaWindowAddresses, OriginalVerifyRope, + OwnerLoan, Rc, RefCell, Result, overlaps, whole, +}; type Indices<'ctx> = [OriginalQsaResidentIndex<'ctx>; 12]; /// The window the bank staged (and its keep count) must be the window armed in `live`. diff --git a/crates/cuda-driver/src/qsa_verification_commit/original_verify_rope.rs b/crates/cuda-driver/src/qsa_verification_commit/original_verify_rope.rs index 7999fc24..cfbf4ed1 100644 --- a/crates/cuda-driver/src/qsa_verification_commit/original_verify_rope.rs +++ b/crates/cuda-driver/src/qsa_verification_commit/original_verify_rope.rs @@ -1,8 +1,7 @@ //! Methods of `OriginalVerifyRope`: `validate`, `validate_scalars`. Functions: `validate_angles`, `whole`, `overlaps`. //! Split out of `verification_commit` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, DeviceRef, Error, OriginalVerifyRope, Result}; impl OriginalVerifyRope<'_> { pub(super) fn validate(&self, c: &Context<'_>, capacity: usize) -> Result<()> { diff --git a/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_capture_commit.rs b/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_capture_commit.rs index 798f4e88..58fe22fe 100644 --- a/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_capture_commit.rs +++ b/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_capture_commit.rs @@ -2,8 +2,10 @@ //! Functions: `fused_io`. Defines `AppendPlan`, `LayerRows`, `AppendAddresses`. use super::original_verify_qsa_journal::{check_armed_window, image_addresses}; -#[allow(unused_imports)] -use super::*; +use super::{ + Arg, Command, Error, NativeBatchWorkspace, OriginalCapture, OriginalQsaMappedAppend, OriginalQsaMappedJournal, + OriginalQsaResidentIndex, OriginalVerifyBank, OriginalVerifyGdnJournal, OriginalVerifyQsaJournal, Result, whole, +}; impl<'ctx> OriginalVerifyQsaJournal<'ctx> { /// EXACT Original commit: restore prewindow tail, append all maxT raw rows diff --git a/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_index_image.rs b/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_index_image.rs index 7e804081..7be50103 100644 --- a/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_index_image.rs +++ b/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_index_image.rs @@ -1,8 +1,7 @@ //! The retained index image of a layer as the fused indexer launch binds it (`LELEKA_SM120_FUSED_QSA_PRELUDE`). use super::original_verify_qsa_journal::image_addresses; -#[allow(unused_imports)] -use super::*; +use super::{Error, OriginalVerifyGdnJournal, OriginalVerifyQsaJournal, OriginalVerifyRope, Result, whole}; use crate::original_verify::qsa::fused_prelude::{IndexImage, IndexRope}; impl<'ctx> OriginalVerifyQsaJournal<'ctx> { diff --git a/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_loan.rs b/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_loan.rs index 7869463d..492100e5 100644 --- a/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_loan.rs +++ b/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_loan.rs @@ -8,8 +8,10 @@ //! replayed. use super::original_verify_qsa_journal::{check_aligned, image_addresses}; -#[allow(unused_imports)] -use super::*; +use super::{ + DeviceBuffer, Error, Live, OriginalQsaMappedJournal, OriginalQsaResidentIndex, OriginalVerifyQsaJournal, + OriginalVerifyQsaWindowAddresses, RefCell, Result, +}; use crate::owner_loan::LoanError; use std::cell::{Ref, RefMut}; diff --git a/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_publish_discard.rs b/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_publish_discard.rs index 9a81217b..1f85ed17 100644 --- a/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_publish_discard.rs +++ b/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_publish_discard.rs @@ -2,8 +2,10 @@ //! Split out of `verification_commit` to keep its files under the line limit. use super::original_verify_qsa_journal::check_armed_window; -#[allow(unused_imports)] -use super::*; +use super::{ + Cell, Coverage, DeviceBuffer, Error, OriginalQsaMappedJournal, OriginalQsaResidentIndex, OriginalVerifyBank, + OriginalVerifyQsaJournal, Rc, Result, +}; impl<'ctx> OriginalVerifyQsaJournal<'ctx> { // Called only by the closed graph bridge after its actual commit receipt. diff --git a/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_rearm.rs b/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_rearm.rs index 8155a6b7..c93a940c 100644 --- a/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_rearm.rs +++ b/crates/cuda-driver/src/qsa_verification_commit/verify_qsa_journal_rearm.rs @@ -1,8 +1,7 @@ //! The re-arm precondition of the journal (ledger row Q7): between two requests the verifier may keep its recorded //! graphs only if the QSA journal they hold is quiet. -#[allow(unused_imports)] -use super::*; +use super::{Error, OriginalVerifyQsaJournal, Result}; impl OriginalVerifyQsaJournal<'_> { /// The journal is valid, no window is armed, and all twelve indices and mapped journals are idle, published and diff --git a/crates/cuda-driver/src/qwen_dispatch/admission.rs b/crates/cuda-driver/src/qwen_dispatch/admission.rs index 6c355262..8b99b939 100644 --- a/crates/cuda-driver/src/qwen_dispatch/admission.rs +++ b/crates/cuda-driver/src/qwen_dispatch/admission.rs @@ -1,8 +1,9 @@ //! Functions: `admission`, `check_owned`, `admitted_layout`, `buffer_handles` and 1 more. //! Split out of `qwen_dispatch` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Admission, Asset, Backend, Context, DeviceBuffer, Error, Operation, Result, combine, ffi, qwen_ffi, ranges_layout, +}; pub(super) fn admission<'asset>( context: &Context<'_>, diff --git a/crates/cuda-driver/src/qwen_dispatch/cache.rs b/crates/cuda-driver/src/qwen_dispatch/cache.rs index d85f2cf2..a1efdfc5 100644 --- a/crates/cuda-driver/src/qwen_dispatch/cache.rs +++ b/crates/cuda-driver/src/qwen_dispatch/cache.rs @@ -1,8 +1,7 @@ //! Methods of `Cache`: `new`. Implements `Backend for Context`. //! Functions: `restore`, `registered`, `execute`, `prepare_pair` and 3 more. -#[allow(unused_imports)] -use super::*; +use super::{Arguments, Asset, Backend, Cache, Cell, Context, Error, FixedKernel, Operation, Rc, Result, combine, ffi}; impl Cache { pub(in super::super) fn new() -> Self { diff --git a/crates/cuda-driver/src/qwen_dispatch/context.rs b/crates/cuda-driver/src/qwen_dispatch/context.rs index 4039de43..76a38157 100644 --- a/crates/cuda-driver/src/qwen_dispatch/context.rs +++ b/crates/cuda-driver/src/qwen_dispatch/context.rs @@ -1,8 +1,12 @@ //! Groups the submodules `context_gr_gate_mean_inject`, `gdn_ple_fixed_kernels`, `gdn_step_kernels` and 4 more. //! Split out of `qwen_dispatch` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Admission, Arguments, Asset, Backend, Context, DeviceBuffer, Error, FixedKernel, Operation, Result, admission, + combine, execute, ffi, fixed_operands, owned_mtp_scratch, prepare_pair, qwen_ffi, ranges_layout, unload, +}; +#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64", feature = "cuda-driver"))] +use super::prepare_gr_read_set; #[path = "context/context_gr_gate_mean_inject.rs"] mod context_gr_gate_mean_inject; diff --git a/crates/cuda-driver/src/qwen_dispatch/context/context_gr_gate_mean_inject.rs b/crates/cuda-driver/src/qwen_dispatch/context/context_gr_gate_mean_inject.rs index e6ffea8c..96568806 100644 --- a/crates/cuda-driver/src/qwen_dispatch/context/context_gr_gate_mean_inject.rs +++ b/crates/cuda-driver/src/qwen_dispatch/context/context_gr_gate_mean_inject.rs @@ -1,8 +1,7 @@ //! Methods of `Context`: `gr_gate_mean_layer_fused_f32`, `gr_gate_mean_final_unfused_f32`, `gr_inject_residual_f32`,... //! Split out of `context` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, Operation, Result}; impl Context<'_> { /// Layer GR: separate products and ascending stream fused accumulation. diff --git a/crates/cuda-driver/src/qwen_dispatch/context/gdn_ple_fixed_kernels.rs b/crates/cuda-driver/src/qwen_dispatch/context/gdn_ple_fixed_kernels.rs index 87fb497d..92381e23 100644 --- a/crates/cuda-driver/src/qwen_dispatch/context/gdn_ple_fixed_kernels.rs +++ b/crates/cuda-driver/src/qwen_dispatch/context/gdn_ple_fixed_kernels.rs @@ -2,8 +2,7 @@ //! Split out of `context` to keep its files under the line limit. use super::fixed_operands::{GdnConvResult, GdnGates, GdnQkv, GdnStepResult, PleConvResult, QsaPackedKv}; -#[allow(unused_imports)] -use super::*; +use super::{Context, DeviceBuffer, Operation, Result}; impl Context<'_> { /// Closed QSA block topk; unqualified assets refuse before mutation. diff --git a/crates/cuda-driver/src/qwen_dispatch/context/gdn_step_kernels.rs b/crates/cuda-driver/src/qwen_dispatch/context/gdn_step_kernels.rs index 86c62f4d..cf11276b 100644 --- a/crates/cuda-driver/src/qwen_dispatch/context/gdn_step_kernels.rs +++ b/crates/cuda-driver/src/qwen_dispatch/context/gdn_step_kernels.rs @@ -2,8 +2,10 @@ //! Split out of `context` to keep its files under the line limit. use super::fixed_operands::{GdnGates, GdnOutNormInput, GdnStepProducts, GdnStepResult}; -#[allow(unused_imports)] -use super::*; +use super::{ + Admission, Arguments, Asset, Context, DeviceBuffer, Error, Operation, Result, admission, execute, ffi, qwen_ffi, + ranges_layout, unload, +}; impl Context<'_> { /// The unchanged recurrence consumes fixed Q/K/V ranges of completed diff --git a/crates/cuda-driver/src/qwen_dispatch/context/gr_read_chain.rs b/crates/cuda-driver/src/qwen_dispatch/context/gr_read_chain.rs index 942e17da..d6b450b2 100644 --- a/crates/cuda-driver/src/qwen_dispatch/context/gr_read_chain.rs +++ b/crates/cuda-driver/src/qwen_dispatch/context/gr_read_chain.rs @@ -2,8 +2,12 @@ //! Methods of `Context`: `gr_read_chain_queued`, `admit_gr_read`, `gr_stage`, `gr_run_chain` and 8 more. use super::fixed_operands::{GrReadInputs, GrReadOutputs}; +use super::{Admission, Asset, Context, DeviceBuffer, Error, Operation, Result, admission, ffi, qwen_ffi}; +#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64", feature = "cuda-driver"))] +use super::prepare_gr_read_set; +// used only with some cargo features or targets of this crate #[allow(unused_imports)] -use super::*; +use super::{Arguments, FixedKernel, combine}; /// One admitted stage of the GR read chain: its sealed asset, layout and operand handles. type GrStage<'a> = (&'a Asset, qwen_ffi::Layout, [ffi::BufferHandle; 9]); diff --git a/crates/cuda-driver/src/qwen_dispatch/context/mtp_dense_attention.rs b/crates/cuda-driver/src/qwen_dispatch/context/mtp_dense_attention.rs index edaf2192..9dd77502 100644 --- a/crates/cuda-driver/src/qwen_dispatch/context/mtp_dense_attention.rs +++ b/crates/cuda-driver/src/qwen_dispatch/context/mtp_dense_attention.rs @@ -2,8 +2,10 @@ //! Functions: `dense_admission`, `dense_clear`, `ring_active`. Defines `DensePlan`. use super::fixed_operands::{MtpDenseKv, MtpRingWindow}; -#[allow(unused_imports)] -use super::*; +use super::{ + Admission, Arguments, Asset, Backend, Context, DeviceBuffer, Error, Operation, Result, admission, combine, execute, + ffi, owned_mtp_scratch, prepare_pair, qwen_ffi, ranges_layout, +}; /// The layouts and sealed assets of the dense MTP attention pair. struct DensePlan { diff --git a/crates/cuda-driver/src/qwen_dispatch/context/mtp_fixed_kernels.rs b/crates/cuda-driver/src/qwen_dispatch/context/mtp_fixed_kernels.rs index 78cac380..2f41c504 100644 --- a/crates/cuda-driver/src/qwen_dispatch/context/mtp_fixed_kernels.rs +++ b/crates/cuda-driver/src/qwen_dispatch/context/mtp_fixed_kernels.rs @@ -6,7 +6,7 @@ use super::fixed_operands::{ MtpGrMlpOutputs, MtpGrMlpResidual, MtpGrProducts, MtpGrWeights, MtpQuantizedInput, MtpS2SelectedExpert, MtpS2TileWeights, }; -use super::*; +use super::{Admission, Arguments, Context, DeviceBuffer, Operation, Result, admission, execute, qwen_ffi}; impl Context<'_> { /// Source-defined fixed 2560-value embedding RMS normalization. The diff --git a/crates/cuda-driver/src/qwen_dispatch/context/qsa_fixed_kernels.rs b/crates/cuda-driver/src/qwen_dispatch/context/qsa_fixed_kernels.rs index b4cc3041..c6eee457 100644 --- a/crates/cuda-driver/src/qwen_dispatch/context/qsa_fixed_kernels.rs +++ b/crates/cuda-driver/src/qwen_dispatch/context/qsa_fixed_kernels.rs @@ -2,8 +2,7 @@ //! Split out of `context` to keep its files under the line limit. use super::fixed_operands::{QsaIndexAppendSource, QsaPooledImage}; -#[allow(unused_imports)] -use super::*; +use super::{Admission, Arguments, Context, DeviceBuffer, Error, Operation, Result, admission, execute, qwen_ffi}; impl Context<'_> { pub(in super::super) fn kar_ple_call( diff --git a/crates/cuda-driver/src/qwen_dispatch/fixed_operands.rs b/crates/cuda-driver/src/qwen_dispatch/fixed_operands.rs index b2100083..007d2693 100644 --- a/crates/cuda-driver/src/qwen_dispatch/fixed_operands.rs +++ b/crates/cuda-driver/src/qwen_dispatch/fixed_operands.rs @@ -1,7 +1,7 @@ //! Operand groups of the closed fixed-ABI kernels of `Context`: the buffers that one kernel reads together or writes //! together, so that a call names them by role instead of by position. The grouping never changes the kernel order. -use super::*; +use super::DeviceBuffer; /// The fused GR weights of one MTP layer read: the RMS norm, the down and up projections and the injection /// projection. diff --git a/crates/cuda-driver/src/qwen_dispatch/prepare_gr_read_set.rs b/crates/cuda-driver/src/qwen_dispatch/prepare_gr_read_set.rs index ab16c5c5..770ef46c 100644 --- a/crates/cuda-driver/src/qwen_dispatch/prepare_gr_read_set.rs +++ b/crates/cuda-driver/src/qwen_dispatch/prepare_gr_read_set.rs @@ -1,8 +1,10 @@ //! Functions: `prepare_gr_read_set`, `load_gr_missing`, `load_gr_entry`, `unload_gr_pending` and 12 more. //! Split out of `qwen_dispatch` to keep its files under the line limit. +use super::{Backend, Cache, Error, OPERATIONS, Operation, Result, combine, ffi, qwen_ffi, restore}; +// used only with some cargo features or targets of this crate #[allow(unused_imports)] -use super::*; +use super::{Asset, Cell, Context, FixedKernel}; #[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64", feature = "cuda-driver"))] use crate::FixedOperation; diff --git a/crates/cuda-driver/src/qwen_dispatch/tests/full_s2_bank_extent.rs b/crates/cuda-driver/src/qwen_dispatch/tests/full_s2_bank_extent.rs index 953ad21a..0e5f59d0 100644 --- a/crates/cuda-driver/src/qwen_dispatch/tests/full_s2_bank_extent.rs +++ b/crates/cuda-driver/src/qwen_dispatch/tests/full_s2_bank_extent.rs @@ -2,8 +2,7 @@ //! mtp_new_ninth_output_and_scale_extent_refuse, kar_ple_qualified_receipt_corruption_refuses_before_mutation, //! kar_ple_whole_spans_require_all_disjoint_allocations .... -#[allow(unused_imports)] -use super::*; +use super::{Asset, Cache, Error, Mock, Operation, arguments, execute, ffi, qwen_ffi, ranges_layout, ready}; #[test] fn full_s2_bank_extent_and_output_refusals() { diff --git a/crates/cuda-driver/src/qwen_dispatch/tests/moe_new_preflight_requires_exact.rs b/crates/cuda-driver/src/qwen_dispatch/tests/moe_new_preflight_requires_exact.rs index ef5fabb3..2a0b40ff 100644 --- a/crates/cuda-driver/src/qwen_dispatch/tests/moe_new_preflight_requires_exact.rs +++ b/crates/cuda-driver/src/qwen_dispatch/tests/moe_new_preflight_requires_exact.rs @@ -4,8 +4,10 @@ //! gdn_fixed_abi_keeps_recurrent_order_and_refuses_prior_output_alias, qwen_fixed_slots_atomic_cache_and_no_quantizer //! .... -#[allow(unused_imports)] -use super::*; +use super::{ + Asset, Backend, Cache, Error, FixedKernel, MOE_OPERATIONS, Mock, OPERATIONS, Operation, arguments, error, execute, + ffi, nested, qwen_ffi, ranges, ranges_layout, ready, unload, +}; #[test] fn moe_new_preflight_requires_exact_disjoint_owner_spans() { diff --git a/crates/cuda-driver/src/qwen_dispatch/tests/qsa_new_slots_keep_atomic.rs b/crates/cuda-driver/src/qwen_dispatch/tests/qsa_new_slots_keep_atomic.rs index da7c241a..cd040117 100644 --- a/crates/cuda-driver/src/qwen_dispatch/tests/qsa_new_slots_keep_atomic.rs +++ b/crates/cuda-driver/src/qwen_dispatch/tests/qsa_new_slots_keep_atomic.rs @@ -10,8 +10,9 @@ target_pointer_width = "64" )))] use super::full_s2_bank_extent::{platform_context, synthetic_buffer}; -#[allow(unused_imports)] -use super::*; +use super::{ + Asset, Cache, Cell, Error, Mock, Operation, Rc, arguments, error, execute, nested, qwen_ffi, ready, unload, +}; use crate::{QsaIndexAppendSource, QsaPackedKv, QsaPooledImage}; #[test] diff --git a/crates/cuda-driver/src/qwen_dispatch/tests/qwen_actual_owner_poison_missing.rs b/crates/cuda-driver/src/qwen_dispatch/tests/qwen_actual_owner_poison_missing.rs index 1be65bd4..03eec93c 100644 --- a/crates/cuda-driver/src/qwen_dispatch/tests/qwen_actual_owner_poison_missing.rs +++ b/crates/cuda-driver/src/qwen_dispatch/tests/qwen_actual_owner_poison_missing.rs @@ -9,8 +9,7 @@ target_pointer_width = "64" )))] use super::full_s2_bank_extent::{platform_context, synthetic_buffer}; -#[allow(unused_imports)] -use super::*; +use super::{Backend, Cache, Error, Mock, Operation, ffi, prepare_pair, qwen_ffi, ranges_layout, ready}; use crate::MtpDenseKv; #[cfg(not(all( diff --git a/crates/cuda-driver/src/qwen_dispatch/tests/qwen_attempted_launch_always_syncs.rs b/crates/cuda-driver/src/qwen_dispatch/tests/qwen_attempted_launch_always_syncs.rs index 0d8ad43f..d2b01e6c 100644 --- a/crates/cuda-driver/src/qwen_dispatch/tests/qwen_attempted_launch_always_syncs.rs +++ b/crates/cuda-driver/src/qwen_dispatch/tests/qwen_attempted_launch_always_syncs.rs @@ -3,8 +3,10 @@ //! qwen_failed_teardown_consumes_once_and_retains_other_slots, qwen_receipt_refusal_precedes_any_backend_mutation, //! qwen_exact_shapes_alignment_endpoints_aliases_and_signed_byte_boundary .... -#[allow(unused_imports)] -use super::*; +use super::{ + Asset, Cache, Cell, Error, Mock, OPERATIONS, Operation, Rc, arguments, error, execute, ffi, native_span, nested, + qwen_ffi, ranges, ranges_layout, ready, unload, +}; #[test] fn qwen_attempted_launch_always_syncs_and_uncertainty_never_retries() { diff --git a/crates/cuda-driver/src/qwen_ffi/asset.rs b/crates/cuda-driver/src/qwen_ffi/asset.rs index cf20571f..da68ecf2 100644 --- a/crates/cuda-driver/src/qwen_ffi/asset.rs +++ b/crates/cuda-driver/src/qwen_ffi/asset.rs @@ -1,8 +1,11 @@ //! Methods of `Arguments`: `new`, `with_layout`, `layout`, `operation` and 2 more. Implements `Drop for Arguments`. //! Functions: `asset`, `asset_group_0`, `asset_group_1`, `asset_group_2` and 10 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Arguments, Asset, BF16_ASSETS, GDN_ASSETS, GR_ASSETS, KAR_PLE_ASSETS, Layout, MOE_ASSETS, MTP_DENSE_ASSETS, + MTP_EXTENDED_ASSETS, MTP_INPUT_ASSETS, MTP_S2_FULL_ASSETS, NonNull, Operation, PLE_ASSETS, PLE_VALUE_FULL_ASSET, + QSA_ASSETS, ROUTE_ASSET, Storage, c_void, ffi, +}; /// The sealed asset of an operation, found in the group that holds it. pub(in super::super) fn asset(operation: Operation) -> Option<&'static Asset> { diff --git a/crates/cuda-driver/src/qwen_ffi/asset_validation_and_bf16_layout.rs b/crates/cuda-driver/src/qwen_ffi/asset_validation_and_bf16_layout.rs index 3ba136b5..9521794e 100644 --- a/crates/cuda-driver/src/qwen_ffi/asset_validation_and_bf16_layout.rs +++ b/crates/cuda-driver/src/qwen_ffi/asset_validation_and_bf16_layout.rs @@ -1,8 +1,10 @@ //! Methods of `Operation`: `has_epsilon`. //! Methods of `Asset`: `validate`, `identity_admitted`, `receipt_complete`, `validate_with_memo`. -#[allow(unused_imports)] -use super::*; +use super::{ + Asset, Error, GDN_RECEIPT, GR_RECEIPT, H, HC, Layout, MOE_RECEIPT, N, OnceLock, Operation, PLE_RECEIPT, PTX_PROOFS, + PtxProof, QSA_ATTENTION_RECEIPT, QSA_GATE_RECEIPT, QSA_NATIVE_RECEIPT, QSA_SELECT_RECEIPT, Result, sha256, +}; impl Operation { pub(in super::super) fn has_epsilon(self) -> bool { diff --git a/crates/cuda-driver/src/qwen_ffi/bf16_receipt_types.rs b/crates/cuda-driver/src/qwen_ffi/bf16_receipt_types.rs index a4d31d0c..336e4fe2 100644 --- a/crates/cuda-driver/src/qwen_ffi/bf16_receipt_types.rs +++ b/crates/cuda-driver/src/qwen_ffi/bf16_receipt_types.rs @@ -1,8 +1,7 @@ //! Items of the parent module. //! BF16_RECEIPT, BF16_ASSETS, PLE_RECEIPT, PLE_ASSETS, PLE_VALUE_FULL_RECEIPT, PLE_VALUE_FULL_ASSET .... -#[allow(unused_imports)] -use super::*; +use super::{Asset, H, HC, N, Operation, Receipt, gdn_asset, gr_asset, moe_asset, ple_asset}; // Source-ordered BF16 component admission; model/actual-alpha gates remain separate. pub(super) const BF16_RECEIPT: Receipt = Receipt { diff --git a/crates/cuda-driver/src/qwen_ffi/mock_asset.rs b/crates/cuda-driver/src/qwen_ffi/mock_asset.rs index e835d667..2412819a 100644 --- a/crates/cuda-driver/src/qwen_ffi/mock_asset.rs +++ b/crates/cuda-driver/src/qwen_ffi/mock_asset.rs @@ -1,8 +1,9 @@ //! Functions: `mock_asset`, `q6_batch_preview_ptx`, `gr_batch_preview_ptx`. //! Split out of `qwen_ffi` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Error, Result, inspect_ptx}; +#[cfg(test)] +use super::{Asset, H, HC, N, Operation, Receipt, sha256}; #[cfg(test)] pub(in super::super) fn mock_asset(operation: Operation) -> Asset { diff --git a/crates/cuda-driver/src/qwen_ffi/mtp_extended_assets_types.rs b/crates/cuda-driver/src/qwen_ffi/mtp_extended_assets_types.rs index a64787b0..1040f3ae 100644 --- a/crates/cuda-driver/src/qwen_ffi/mtp_extended_assets_types.rs +++ b/crates/cuda-driver/src/qwen_ffi/mtp_extended_assets_types.rs @@ -1,8 +1,7 @@ //! Defines `Storage`, `Arguments`. //! MTP_EXTENDED_ASSETS, MTP_S2_FULL_RECEIPT, MTP_S2_FULL_ASSETS, Storage, Arguments. -#[allow(unused_imports)] -use super::*; +use super::{Asset, Layout, MTP_GR_RECEIPT, MTP_S2_RECEIPT, NonNull, Operation, Receipt, c_void}; pub(super) const MTP_EXTENDED_ASSETS: [Asset; 9] = [ Asset { diff --git a/crates/cuda-driver/src/qwen_ffi/mtp_s2_full_layout.rs b/crates/cuda-driver/src/qwen_ffi/mtp_s2_full_layout.rs index a09dc2c5..8557b485 100644 --- a/crates/cuda-driver/src/qwen_ffi/mtp_s2_full_layout.rs +++ b/crates/cuda-driver/src/qwen_ffi/mtp_s2_full_layout.rs @@ -1,8 +1,7 @@ //! Methods of `Layout`: `flat`. //! Functions: `mtp_s2_full_layout`, `mtp_extended_layout`, `mtp_gr_geometry`, `mtp_tile_geometry` and 2 more. -#[allow(unused_imports)] -use super::*; +use super::{Error, Layout, Operation, Result}; /// bytes, align, count, outputs, grid, block of a fixed MTP launch. type Geometry = ([usize; 9], [u64; 9], usize, u16, u32, u32); diff --git a/crates/cuda-driver/src/qwen_ffi/n_types.rs b/crates/cuda-driver/src/qwen_ffi/n_types.rs index f3243cf3..59056ad3 100644 --- a/crates/cuda-driver/src/qwen_ffi/n_types.rs +++ b/crates/cuda-driver/src/qwen_ffi/n_types.rs @@ -1,8 +1,7 @@ //! Defines `Operation`, `Layout`, `Receipt` and 2 more. //! N, HC, H, Operation, OPERATIONS, QSA_OPERATIONS .... -#[allow(unused_imports)] -use super::*; +use super::OnceLock; pub(in super::super) const N: usize = 2560; pub(in super::super) const HC: usize = 4; diff --git a/crates/cuda-driver/src/qwen_ffi/operation.rs b/crates/cuda-driver/src/qwen_ffi/operation.rs index d770d98f..e4aafc87 100644 --- a/crates/cuda-driver/src/qwen_ffi/operation.rs +++ b/crates/cuda-driver/src/qwen_ffi/operation.rs @@ -1,8 +1,10 @@ //! Methods of `Operation`: `entry`, `entry_group_0`, `entry_group_1`, `entry_group_2` and 10 more. //! Functions: `router_layout`. -#[allow(unused_imports)] -use super::*; +use super::{ + CStr, H, HC, Layout, N, Operation, QSA_OPERATIONS, bf16_layout, gdn_layout, kar_ple_layout, moe_layout, + mtp_dense_layout, mtp_extended_layout, mtp_input_layout, mtp_s2_full_layout, ple_layout, qsa_layout, +}; impl Operation { /// The kernel entry point of an operation, found in the group that holds it. diff --git a/crates/cuda-driver/src/qwen_ffi/qsa_attention_receipt_types.rs b/crates/cuda-driver/src/qwen_ffi/qsa_attention_receipt_types.rs index 8ec9045a..24fa6f56 100644 --- a/crates/cuda-driver/src/qwen_ffi/qsa_attention_receipt_types.rs +++ b/crates/cuda-driver/src/qwen_ffi/qsa_attention_receipt_types.rs @@ -1,8 +1,7 @@ //! Items of the parent module. //! QSA_ATTENTION_RECEIPT, QSA_GATE_RECEIPT, QSA_ASSETS, KAR_PLE_RECEIPT, KAR_PLE_ASSETS, MTP_INPUT_RECEIPT .... -#[allow(unused_imports)] -use super::*; +use super::{Asset, H, HC, N, Operation, Receipt, qsa_asset}; pub(super) const QSA_ATTENTION_RECEIPT: Receipt = Receipt { version: 1, diff --git a/crates/cuda-driver/src/qwen_ffi/qsa_layout.rs b/crates/cuda-driver/src/qwen_ffi/qsa_layout.rs index 0f8edf12..27e5f5f8 100644 --- a/crates/cuda-driver/src/qwen_ffi/qsa_layout.rs +++ b/crates/cuda-driver/src/qwen_ffi/qsa_layout.rs @@ -1,8 +1,7 @@ //! Functions: `qsa_layout`, `check_qsa_value`, `qsa_geometry`, `qsa_plain_geometry` and 5 more. Defines `QsaGeometry`. //! Split out of `qwen_ffi` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Error, Layout, Operation, QSA_OPERATIONS, Result}; /// bytes, count, outputs, grid, grid_y and the integer scalar of a QSA launch. type QsaGeometry = ([usize; 9], usize, u16, u32, u32, Option<(u32, usize)>); diff --git a/crates/cuda-driver/src/qwen_ffi/tests/full_s2_expert_scalar.rs b/crates/cuda-driver/src/qwen_ffi/tests/full_s2_expert_scalar.rs index 33bda68d..59bd6494 100644 --- a/crates/cuda-driver/src/qwen_ffi/tests/full_s2_expert_scalar.rs +++ b/crates/cuda-driver/src/qwen_ffi/tests/full_s2_expert_scalar.rs @@ -3,8 +3,10 @@ //! gr_saturation_asset_requires_exact_independent_qualification_and_bytes, //! kar_ple_qualified_receipt_matches_frozen_source_and_ptx .... -#[allow(unused_imports)] -use super::*; +use super::{ + Arguments, Asset, Error, GR_RECEIPT, KAR_PLE_RECEIPT, Layout, Operation, asset, ffi, kar_ple_layout, + mtp_s2_full_layout, sha256, +}; #[test] fn full_s2_expert_scalar_and_fixed_bank_abi() { diff --git a/crates/cuda-driver/src/qwen_ffi/tests/moe_fixed_pointer_abi_extents.rs b/crates/cuda-driver/src/qwen_ffi/tests/moe_fixed_pointer_abi_extents.rs index e04f260a..34543a7b 100644 --- a/crates/cuda-driver/src/qwen_ffi/tests/moe_fixed_pointer_abi_extents.rs +++ b/crates/cuda-driver/src/qwen_ffi/tests/moe_fixed_pointer_abi_extents.rs @@ -2,8 +2,7 @@ //! moe_fixed_pointer_abi_extents_and_qualified_receipts, qwen_hash_known_vectors_and_padding_boundaries, //! qwen_raw_abi_remains_stable_after_moves, qwen_router_has_exact_three_pointer_abi_and_32_by_8_geometry .... -#[allow(unused_imports)] -use super::*; +use super::{Arguments, Asset, Error, Layout, MOE_RECEIPT, OPERATIONS, Operation, asset, ffi, sha256}; /// The frozen layout of one MoE entry: ABI sizes, alignments, parameter count, outputs and grid. struct MoeExpect { diff --git a/crates/cuda-driver/src/qwen_ffi/tests/mtp_new_qualified_assets.rs b/crates/cuda-driver/src/qwen_ffi/tests/mtp_new_qualified_assets.rs index 845033b9..ac2f33f9 100644 --- a/crates/cuda-driver/src/qwen_ffi/tests/mtp_new_qualified_assets.rs +++ b/crates/cuda-driver/src/qwen_ffi/tests/mtp_new_qualified_assets.rs @@ -1,8 +1,7 @@ //! Tests of tests by topic (moved out of the test file by STRA-338): //! mtp_new_qualified_assets_and_fixed_dense_scalar_abi. -#[allow(unused_imports)] -use super::*; +use super::{Arguments, Asset, Error, Layout, Operation, asset, ffi, mtp_dense_layout}; fn assert_forged_pin_is_refused(operation: Operation) { let asset = asset(operation).unwrap(); diff --git a/crates/cuda-driver/src/qwen_ffi/tests/qsa_new_literal_abi_scalar.rs b/crates/cuda-driver/src/qwen_ffi/tests/qsa_new_literal_abi_scalar.rs index d3044656..89376f3f 100644 --- a/crates/cuda-driver/src/qwen_ffi/tests/qsa_new_literal_abi_scalar.rs +++ b/crates/cuda-driver/src/qwen_ffi/tests/qsa_new_literal_abi_scalar.rs @@ -1,8 +1,7 @@ //! Tests of `tests` by topic: qsa_new_literal_abi_scalar_order_and_geometry, //! qsa_new_position_block_boundaries_and_attention_width_refusals. -#[allow(unused_imports)] -use super::*; +use super::{Arguments, Error, Layout, OPERATIONS, Operation, QSA_OPERATIONS, asset, ffi, qsa_layout}; /// One independently frozen QSA entry: operation, entry name, ABI sizes, geometry and the scalar parameter index. struct QsaCase { diff --git a/crates/cuda-driver/src/qwen_shared_tail.rs b/crates/cuda-driver/src/qwen_shared_tail.rs index 2f82e84d..1915001a 100644 --- a/crates/cuda-driver/src/qwen_shared_tail.rs +++ b/crates/cuda-driver/src/qwen_shared_tail.rs @@ -1,6 +1,9 @@ //! Experimental closed shared FFN/combine queue. Every arithmetic entry is original. //! Runtime authenticates model/frame/route provenance; this module owns only transport. -use super::*; +use super::{ + Admission, Arguments, Context, DeviceBuffer, Error, Operation, Result, admission, combine, ffi, qwen_ffi, + registered, +}; use crate::{DenseFormat, ProjectionKind, ProjectionSpec, projection_ranges, projection_shape}; const SIZES: [usize; 11] = [2560, 2560, 2560, 10240, 4, 10240, 10240, 2880, 720, 48, 40]; diff --git a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace.rs b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace.rs index a0320b2a..abc7b085 100644 --- a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace.rs +++ b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace.rs @@ -1,8 +1,12 @@ //! Groups the submodules `shared_expert_workspace_append_close`, `shared_expert_workspace_bring_up`, `shared_expert_... //! Split out of `qwen_shared_tail` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Admission, Arguments, Command, Context, DenseFormat, DeviceBuffer, Error, Kernels, OPERATIONS, Operation, Pair, + ProjectionDims, ProjectionKind, ProjectionScratch, ProjectionStyle, RESERVE, Result, SIZES, SharedExpertWeights, + SharedExpertWorkspace, SharedTailCompletion, TOTAL, admission, append_finite, append_projection, combine, ffi, + first_refusal, qwen_ffi, registered, staging, status_spans, +}; #[path = "shared_expert_workspace/shared_expert_workspace_append_close.rs"] mod shared_expert_workspace_append_close; diff --git a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_append_close.rs b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_append_close.rs index 76def0d8..2174fc99 100644 --- a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_append_close.rs +++ b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_append_close.rs @@ -1,8 +1,10 @@ //! Methods of `SharedExpertWorkspace`: `append_qwen`, `close`, `close_inner`, `unload_module`. //! Functions: `release_buffer`. -#[allow(unused_imports)] -use super::*; +use super::{ + Admission, Arguments, Command, Context, DeviceBuffer, Error, Operation, Result, SharedExpertWorkspace, admission, + combine, ffi, qwen_ffi, +}; impl<'ctx> SharedExpertWorkspace<'ctx> { pub(in super::super) fn append_qwen( diff --git a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_bring_up.rs b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_bring_up.rs index 1c73a6da..d79c4ec2 100644 --- a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_bring_up.rs +++ b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_bring_up.rs @@ -1,8 +1,10 @@ //! Methods of `SharedExpertWorkspace`: `new`, `init_resources`, `load_kernels`, `allocated_bytes` and 6 more. //! Functions: `check_new`, `common_pair`, `projection_pairs`. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DenseFormat, DeviceBuffer, Error, Kernels, OPERATIONS, Pair, ProjectionKind, ProjectionStyle, RESERVE, + Result, SIZES, SharedExpertWeights, SharedExpertWorkspace, TOTAL, combine, ffi, qwen_ffi, registered, +}; impl<'ctx> SharedExpertWorkspace<'ctx> { pub(in super::super) fn new(context: &'ctx Context<'ctx>) -> Result { diff --git a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_compose.rs b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_compose.rs index 662dcb35..a00818ad 100644 --- a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_compose.rs +++ b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_expert_workspace_compose.rs @@ -3,7 +3,7 @@ #[allow(unused_imports)] use super::shared_phases::SharedStaging; -use super::*; +use super::{DeviceBuffer, Error, Result, SharedExpertWeights, SharedExpertWorkspace, SharedTailCompletion}; impl<'ctx> SharedExpertWorkspace<'ctx> { /// Bounded completed queue, never a general asynchronous/operator API. diff --git a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_phases.rs b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_phases.rs index 7d69e760..4441ea6f 100644 --- a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_phases.rs +++ b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace/shared_phases.rs @@ -1,7 +1,10 @@ //! STRA-338 size: the phases of `SharedExpertWorkspace::compose`, extracted in call order. -#[allow(unused_imports)] -use super::*; +use super::{ + Command, DeviceBuffer, Error, Operation, ProjectionDims, ProjectionScratch, Result, SharedExpertWeights, + SharedExpertWorkspace, SharedTailCompletion, append_finite, append_projection, combine, ffi, first_refusal, + staging, status_spans, +}; use crate::CurrentGuard; /// The projection shape of the shared gate and up projections. diff --git a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace_drop.rs b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace_drop.rs index 489413d0..eb503d59 100644 --- a/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace_drop.rs +++ b/crates/cuda-driver/src/qwen_shared_tail/shared_expert_workspace_drop.rs @@ -1,8 +1,10 @@ //! Methods of `Command`: `launch`. Implements `Drop for SharedExpertWorkspace`. //! Functions: `staging`, `status_spans`, `first_refusal`, `append_finite` and 3 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Command, Context, Error, Pair, ProjectionSpec, ProjectionStyle, Result, STAGES, SharedExpertWorkspace, + SharedTailRefusal, ffi, projection_ranges, projection_shape, +}; impl Drop for SharedExpertWorkspace<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/qwen_shared_tail/shared_gu_kind.rs b/crates/cuda-driver/src/qwen_shared_tail/shared_gu_kind.rs index a958845f..8da85b14 100644 --- a/crates/cuda-driver/src/qwen_shared_tail/shared_gu_kind.rs +++ b/crates/cuda-driver/src/qwen_shared_tail/shared_gu_kind.rs @@ -1,8 +1,9 @@ //! Methods of `SharedGuKind`: `index`, `weight_bytes`. Methods of `SharedDownKind`: `index`, `weight_bytes`. //! Split out of `qwen_shared_tail` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, Result, SharedDownKind, SharedExpertWorkspace, SharedGuKind, SharedTailCompletion, SharedTailRefusal, +}; impl SharedGuKind { pub(super) fn index(self) -> usize { diff --git a/crates/cuda-driver/src/qwen_shared_tail_gpu/guard_probe.rs b/crates/cuda-driver/src/qwen_shared_tail_gpu/guard_probe.rs index e505bd06..5ea71dc0 100644 --- a/crates/cuda-driver/src/qwen_shared_tail_gpu/guard_probe.rs +++ b/crates/cuda-driver/src/qwen_shared_tail_gpu/guard_probe.rs @@ -1,8 +1,11 @@ //! Functions: `refused`, `probe_inputs`, `probe_weights`, `probe_alias` and 12 more. //! Split out of `shared_tail_gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + ComposeCase, Context, DOWN, DeviceBuffer, Error, GU, Oracle, ProjectionKinds, Report, RestoreHandle, Result, + SharedDownKind, SharedExpertWeights, SharedExpertWorkspace, SharedGuKind, TOTAL, combine, compare, down_payload, + f32_bytes, gu_payload, input, original, packet, read, scalar_weights, weights, +}; /// 1 when `result` is the expected refusal, else 0. fn refused(result: Result, expected: Error) -> usize { diff --git a/crates/cuda-driver/src/qwen_shared_tail_gpu/original.rs b/crates/cuda-driver/src/qwen_shared_tail_gpu/original.rs index 08f323ee..ad4f16a5 100644 --- a/crates/cuda-driver/src/qwen_shared_tail_gpu/original.rs +++ b/crates/cuda-driver/src/qwen_shared_tail_gpu/original.rs @@ -1,8 +1,11 @@ //! Methods of `OldPath`: `stage`, `product`, `gate`, `up` and 6 more. Methods of `RestoreHandle`: `new`. //! Implements `Drop for RestoreHandle`. Functions: `refused`, `chain`, `original`, `compare` and 1 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DenseFormat, DeviceBuffer, Error, Oracle, ProjectionKind, ProjectionSpec, Report, RestoreHandle, Result, + SIZES, SharedDownKind, SharedExpertWorkspace, SharedGuKind, SharedTailCompletion, SharedTailRefusal, f32_bytes, + ffi, finite, original_projection, read, weights, +}; /// A stage of the old path refused: why, and at which stage. type Stop = Option<(SharedTailRefusal, &'static str)>; diff --git a/crates/cuda-driver/src/qwen_shared_tail_gpu/read.rs b/crates/cuda-driver/src/qwen_shared_tail_gpu/read.rs index 03401b08..96db614f 100644 --- a/crates/cuda-driver/src/qwen_shared_tail_gpu/read.rs +++ b/crates/cuda-driver/src/qwen_shared_tail_gpu/read.rs @@ -1,8 +1,10 @@ //! Functions: `read`, `f32_bytes`, `finite`, `input` and 7 more. //! Split out of `shared_tail_gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DenseFormat, DeviceBuffer, ProjectionKind, ProjectionSpec, Q5KProjectionShape, Q6KProjectionShape, Result, + SharedDownKind, SharedExpertWeights, SharedGuKind, +}; pub(super) fn read(buffer: &DeviceBuffer<'_>) -> Result> { let mut bytes = vec![0; buffer.len()]; diff --git a/crates/cuda-driver/src/routed_columns_loan_gpu/loan_cases.rs b/crates/cuda-driver/src/routed_columns_loan_gpu/loan_cases.rs index 67516ef1..ca1eb2ab 100644 --- a/crates/cuda-driver/src/routed_columns_loan_gpu/loan_cases.rs +++ b/crates/cuda-driver/src/routed_columns_loan_gpu/loan_cases.rs @@ -1,7 +1,10 @@ //! The gate/up cases of the borrowed-table proof: the original path first, then the loan. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, LoanProof, MmqFormat, MmqWeights, Report, Result, RoutedColumnsLoan, + RoutedFiniteStage, RoutedFormat, RoutedGateUpQ8, RoutedGroupWorkspace, RoutedStageFiniteGuard, check_table, + combine, compare, input, raw, read, refuse, upload, +}; /// The owners of one case besides the inputs, released together after the run. #[derive(Default)] diff --git a/crates/cuda-driver/src/routed_group_workspace.rs b/crates/cuda-driver/src/routed_group_workspace.rs index 724ebd1f..0b291ae6 100644 --- a/crates/cuda-driver/src/routed_group_workspace.rs +++ b/crates/cuda-driver/src/routed_group_workspace.rs @@ -1,5 +1,10 @@ //! Exclusive fixed grouped-native transport storage; no numerical certificate. -use super::*; +use super::{ + Context, DeviceBuffer, Error, FixedKernel, FixedOperation, NativeWeights, ProjectionKind, ProjectionShape, + ProjectionSpec, Result, RoutedFormat, RoutedGateUpQ8, combine, ffi, projection_ranges, projection_shape, +}; +#[cfg(test)] +use super::{DownColumns, Driver, MmqFormat, MmqWeights, RoutedFiniteStage, RoutedStageFiniteGuard}; const TABLE_BYTES: usize = 64 * 8; const Q8_BYTES: usize = 64 * 720; diff --git a/crates/cuda-driver/src/routed_group_workspace/context.rs b/crates/cuda-driver/src/routed_group_workspace/context.rs index b3865270..ec197dd6 100644 --- a/crates/cuda-driver/src/routed_group_workspace/context.rs +++ b/crates/cuda-driver/src/routed_group_workspace/context.rs @@ -1,8 +1,11 @@ //! Methods of `Context`: `routed_group_workspace`. //! Methods of `RoutedGroupWorkspace`: `allocated_bytes`, `is_failed`, `validate`, `disjoint` and 12 more. -#[allow(unused_imports)] -use super::*; +use super::{ + ALLOCATED_BYTES, Context, DeviceBuffer, Error, FixedKernel, FixedOperation, NativeWeights, ProjectionKind, + ProjectionSpec, Q8_BYTES, Result, RoutedDownShape, RoutedFormat, RoutedGateUpQ8, RoutedGroupWorkspace, TABLE_BYTES, + combine, ffi, projection_shape, +}; impl<'ctx> Context<'ctx> { pub fn routed_group_workspace(&'ctx self) -> Result> { diff --git a/crates/cuda-driver/src/routed_group_workspace/routed_group_down_projection.rs b/crates/cuda-driver/src/routed_group_workspace/routed_group_down_projection.rs index 31670315..3911c749 100644 --- a/crates/cuda-driver/src/routed_group_workspace/routed_group_down_projection.rs +++ b/crates/cuda-driver/src/routed_group_workspace/routed_group_down_projection.rs @@ -4,8 +4,11 @@ #[allow(unused_imports)] use super::context::{check_table, reserve_pointers}; -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, FixedKernel, FixedOperation, NativeWeights, ProjectionKind, ProjectionShape, + ProjectionSpec, Result, RoutedColumnsLoan, RoutedDownShape, RoutedFormat, RoutedGateUpQ8, RoutedGroupWorkspace, + combine, ffi, projection_ranges, projection_shape, +}; /// The buffers of one grouped down projection: weights, hidden rows and output, by handle and size. struct DownIo { diff --git a/crates/cuda-driver/src/routed_group_workspace_gpu/down_case.rs b/crates/cuda-driver/src/routed_group_workspace_gpu/down_case.rs index 6dcea6a5..173be232 100644 --- a/crates/cuda-driver/src/routed_group_workspace_gpu/down_case.rs +++ b/crates/cuda-driver/src/routed_group_workspace_gpu/down_case.rs @@ -1,7 +1,9 @@ //! Down case of the grouped workspace component proof: the original path first, then the workspace. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, DownColumns, Error, MmqWeights, ProofCase, Q8_BYTES, Report, Result, RoutedDownShape, + RoutedFormat, RoutedGroupWorkspace, combine, compare, dual_format, read, refused, upload, values, weights, +}; /// The owners of one down case, released together after the run. #[derive(Default)] diff --git a/crates/cuda-driver/src/routed_group_workspace_gpu/gu_case.rs b/crates/cuda-driver/src/routed_group_workspace_gpu/gu_case.rs index dbfd7d3f..07837ae9 100644 --- a/crates/cuda-driver/src/routed_group_workspace_gpu/gu_case.rs +++ b/crates/cuda-driver/src/routed_group_workspace_gpu/gu_case.rs @@ -1,7 +1,9 @@ //! Gate/up case of the grouped workspace component proof: the original path first, then the workspace. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, MmqWeights, ProofCase, Report, Result, RoutedFormat, RoutedGateUpQ8, + RoutedGroupWorkspace, Subject, TABLE_BYTES, combine, compare, dual_format, read, refused, upload, values, weights, +}; /// The owners of one gate/up case besides the inputs, released together after the run. #[derive(Default)] diff --git a/crates/cuda-driver/src/routed_resident_queue.rs b/crates/cuda-driver/src/routed_resident_queue.rs index 38f4c33c..452ec6a7 100644 --- a/crates/cuda-driver/src/routed_resident_queue.rs +++ b/crates/cuda-driver/src/routed_resident_queue.rs @@ -1,6 +1,11 @@ //! Closed routed resident pipeline, using only the original grouped kernels. //! Completion is a drained real-buffer loan, never a session/row certificate. -use super::*; +use super::{ + Context, DeviceBuffer, Error, FixedOperation, ProjectionKind, ProjectionSpec, Rc, Result, RoutedFormat, + RoutedGateUpQ8, combine, ffi, projection_shape, +}; +#[cfg(test)] +use super::DownColumns; const TABLE: usize = 512; const Q8: usize = 46_080; diff --git a/crates/cuda-driver/src/routed_resident_queue/compose_phases.rs b/crates/cuda-driver/src/routed_resident_queue/compose_phases.rs index b3647299..7b6eee2d 100644 --- a/crates/cuda-driver/src/routed_resident_queue/compose_phases.rs +++ b/crates/cuda-driver/src/routed_resident_queue/compose_phases.rs @@ -1,7 +1,10 @@ //! STRA-338 size: the phases of `RoutedResidentQueue::compose`, extracted in call order. -#[allow(unused_imports)] -use super::*; +use super::{ + Command, DeviceBuffer, Error, FixedOperation, ProjectionKind, ProjectionSpec, Q8, Result, RoutedFormat, + RoutedGateUpQ8, RoutedResidentQueue, RoutedResidentWeights, STATUS, TABLE, combine, ffi, gu_operation, + projection_shape, scan, +}; /// Device spans of one routed-resident compose. pub(super) struct ComposeSpans { diff --git a/crates/cuda-driver/src/routed_resident_queue/routed_resident_completion.rs b/crates/cuda-driver/src/routed_resident_queue/routed_resident_completion.rs index 287ff1d8..da16ad00 100644 --- a/crates/cuda-driver/src/routed_resident_queue/routed_resident_completion.rs +++ b/crates/cuda-driver/src/routed_resident_queue/routed_resident_completion.rs @@ -1,8 +1,10 @@ //! Methods of `RoutedResidentCompletion`: `numerical_refusal`, `completed_hidden`, `completed_down`. //! Methods of `Context`: `routed_resident_queue`. -#[allow(unused_imports)] -use super::*; +use super::{ + CHARGE, Context, DeviceBuffer, Error, FixedOperation, Q8, RESERVE, Result, RoutedResidentCompletion, + RoutedResidentQueue, RoutedResidentRefusal, STATUS, TABLE, combine, +}; impl<'loan, 'buffer, 'ctx> RoutedResidentCompletion<'loan, 'buffer, 'ctx> { pub fn numerical_refusal(&self) -> Option { diff --git a/crates/cuda-driver/src/routed_resident_queue/routed_resident_queue_drop.rs b/crates/cuda-driver/src/routed_resident_queue/routed_resident_queue_drop.rs index 2d60c301..95057b5f 100644 --- a/crates/cuda-driver/src/routed_resident_queue/routed_resident_queue_drop.rs +++ b/crates/cuda-driver/src/routed_resident_queue/routed_resident_queue_drop.rs @@ -1,8 +1,7 @@ //! Methods of `Command`: `launch`. Implements `Drop for RoutedResidentQueue`. Functions: `gu_operation`, `scan`. //! Split out of `routed_resident_queue` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{Command, Context, Error, FixedOperation, Result, RoutedFormat, RoutedResidentQueue, ffi}; impl Drop for RoutedResidentQueue<'_> { fn drop(&mut self) { diff --git a/crates/cuda-driver/src/routed_resident_queue/routed_resident_queue_operations.rs b/crates/cuda-driver/src/routed_resident_queue/routed_resident_queue_operations.rs index 2d60a383..7da97152 100644 --- a/crates/cuda-driver/src/routed_resident_queue/routed_resident_queue_operations.rs +++ b/crates/cuda-driver/src/routed_resident_queue/routed_resident_queue_operations.rs @@ -4,7 +4,10 @@ #[allow(unused_imports)] use super::compose_phases::{ComposeHostBuffers, compose_operations, zeroed_staging}; -use super::*; +use super::{ + DeviceBuffer, Error, Q8, Rc, Result, RoutedGateUpQ8, RoutedResidentCompletion, RoutedResidentOutputs, + RoutedResidentQueue, RoutedResidentWeights, STATUS, TABLE, combine, ffi, +}; impl<'ctx> RoutedResidentQueue<'ctx> { pub fn allocated_bytes(&self) -> usize { diff --git a/crates/cuda-driver/src/routed_resident_queue_gpu/queue_cases.rs b/crates/cuda-driver/src/routed_resident_queue_gpu/queue_cases.rs index d06a93e1..4dc5bb0d 100644 --- a/crates/cuda-driver/src/routed_resident_queue_gpu/queue_cases.rs +++ b/crates/cuda-driver/src/routed_resident_queue_gpu/queue_cases.rs @@ -1,8 +1,11 @@ //! Methods of `CaseRig`: `allocate`, `run`, `pair_over_inputs`, `refusal_pass` and 3 more. //! Functions: `with_columns`, `block_width`, `case`, `refusal_step` and 2 more. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, Error, Report, Result, RoutedFormat, RoutedGateUpQ8, RoutedResidentOutputs, + RoutedResidentQueue, RoutedResidentRefusal, RoutedResidentWeights, activation, combine, pair, read, upload, view, + weights, +}; /// The weights, products and inputs of one case. struct CaseRig<'a> { diff --git a/crates/cuda-driver/src/routed_resident_queue_gpu/run.rs b/crates/cuda-driver/src/routed_resident_queue_gpu/run.rs index d52a5370..8fa12fd1 100644 --- a/crates/cuda-driver/src/routed_resident_queue_gpu/run.rs +++ b/crates/cuda-driver/src/routed_resident_queue_gpu/run.rs @@ -1,8 +1,7 @@ //! Functions: `run`. //! Split out of `gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{CHARGE, CaseSpec, Context, Error, Report, Result, RoutedFormat, RoutedResidentQueue, case, combine}; pub(super) fn run(context: &Context<'_>, foreign: &Context<'_>) -> Result { let mut queue = Some(context.routed_resident_queue()?); diff --git a/crates/cuda-driver/src/routed_resident_queue_gpu/upload.rs b/crates/cuda-driver/src/routed_resident_queue_gpu/upload.rs index 0c42f402..9c2a4176 100644 --- a/crates/cuda-driver/src/routed_resident_queue_gpu/upload.rs +++ b/crates/cuda-driver/src/routed_resident_queue_gpu/upload.rs @@ -1,8 +1,10 @@ //! Functions: `upload`, `read`, `weights`, `activation` and 9 more. Defines `Refusal`. //! Split out of `gpu` to keep its files under the line limit. -#[allow(unused_imports)] -use super::*; +use super::{ + Context, DeviceBuffer, DownColumns, Error, QueueProof, Report, Result, RoutedFormat, RoutedGateUpQ8, + RoutedResidentCompletion, RoutedResidentOutputs, RoutedResidentRefusal, RoutedResidentWeights, combine, +}; pub(super) fn upload<'a>(context: &'a Context<'_>, bytes: &[u8]) -> Result> { let mut buffer = context.allocate(bytes.len())?; diff --git a/crates/cuda-driver/src/routed_stage_finite_guard.rs b/crates/cuda-driver/src/routed_stage_finite_guard.rs index 04cd815a..5523d37b 100644 --- a/crates/cuda-driver/src/routed_stage_finite_guard.rs +++ b/crates/cuda-driver/src/routed_stage_finite_guard.rs @@ -1,6 +1,8 @@ //! Closed complete finite checks for genuine grouped routed stage outputs. //! Reuses the pinned integer exponent scan; performs no floating-point arithmetic. -use super::*; +use super::{Context, DeviceBuffer, Error, Rc, Result, combine, ffi}; +#[cfg(test)] +use super::Driver; const STATUS_BYTES: usize = 4; diff --git a/scripts/dev/explicit_imports.py b/scripts/dev/explicit_imports.py index a11e3f69..505c191d 100644 --- a/scripts/dev/explicit_imports.py +++ b/scripts/dev/explicit_imports.py @@ -358,6 +358,7 @@ class Plan: self.platform_residual = False self._cond_index = None self._platform_cache = {} + self._test_token_cache = {} self._test_files = None self.cfg_names = collections.defaultdict(dict) # file -> {name: cfg expression its import needs} @@ -524,6 +525,16 @@ class Plan: self._platform_cache[f] = out return out + def test_tokens(self, f): + """Identifiers of the items of `f` that exist only in test builds (`#[cfg(test)] mod tests { .. }`, `#[test]` fns).""" + if f not in self._test_token_cache: + out = set() + for attrs, head, start, end in statements(strip_code(self.texts[f], True)): + if cfg_false_without_test(attrs) or re.search(r"#\[test\]", attrs): + out |= set(re.findall(IDENT, head)) + self._test_token_cache[f] = out + return self._test_token_cache[f] + def included_files(self, f, seen): """The files `include!`d by `f`, directly or through each other.""" out = [] @@ -728,7 +739,7 @@ def check_round(wt, package, configs): for k, v in flagged(ms, "errors").items(): errors[k] |= v a_flags.append(flagged(a, "unused")) - b_flags.append(flagged(b, "unused", test_units_only=True)) + b_flags.append(flagged(b, "unused")) return errors, a_flags, b_flags @@ -831,17 +842,29 @@ def main(): imp = plan.imports.get(f, {}) r = rel(f) for name in list(imp): + kind = imp[name] + if kind == "residual": + continue test_only = plan.is_test_only(f) - a_unused = test_only or all(name in fl.get(r, ()) for fl in a_flags) + a_unused = all(name in fl.get(r, ()) for fl in a_flags) b_unused = all(name in fl.get(r, ()) for fl in b_flags) - if a_unused and b_unused and f in plan.platform_files and imp[name] != "residual" and name in plan.platform_tokens(f) and name[:1].isupper(): - imp[name] = "residual" # probably used by code of another target: keep, under a narrow allow - changed = True - elif a_unused and b_unused and imp[name] != "residual": - del imp[name] - changed = True - elif a_unused and not test_only and imp[name] == "normal": - imp[name] = "test" + # The build without cfg(test) tells which names the non-test code uses. The build with cfg(test) cannot be + # trusted for a file that both builds compile: cargo prints a warning that two units share only once. + if test_only: + drop = b_unused + elif kind == "normal": + drop = a_unused and name not in plan.test_tokens(f) + if a_unused and not drop: + imp[name] = "test" # only the test code of the file uses it + changed = True + continue + else: + drop = b_unused + if drop: + if f in plan.platform_files and name in plan.platform_tokens(f) and name[:1].isupper(): + imp[name] = "residual" # probably used by code of another target: keep, under a narrow allow + else: + del imp[name] changed = True plan.write() if not changed: