Repository navigation
Expand file tree
/
Copy pathknowledge_questions.jsonl
More file actions
50 lines (50 loc) · 22.8 KB
/
Copy pathknowledge_questions.jsonl
File metadata and controls
50 lines (50 loc) · 22.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{"question": "Analyze CUDA memory hierarchy and access efficiency.\n\nYour answer should:\n1. Explain the roles of global memory, shared memory, local memory, constant memory, and registers\n2. Compare their relative latency, scope, and typical use cases\n3. Explain what coalesced global memory access means\n4. Describe how poor memory access patterns can reduce GPU performance\n\nProvide a concise technical explanation and include at least one example of an efficient and inefficient memory access pattern."}
{"question": "Explain CUDA thread organization and indexing.\n\nYour answer should:\n1. Describe the relationship between threads, blocks, and grids\n2. Explain the purpose of threadIdx, blockIdx, blockDim, and gridDim\n3. Compare 1D, 2D, and 3D thread layouts and when each is appropriate\n4. Explain how boundary conditions should be handled when the problem size is not divisible by the block size\n\nDo not provide source code. Use diagrams or formulas where helpful."}
{"question": "Analyze synchronization mechanisms in CUDA.\n\nYour answer should:\n1. Explain what block-level synchronization conceptually accomplishes\n2. Describe which threads can be synchronized using block-level synchronization\n3. Explain why threads from different blocks generally cannot synchronize inside a normal kernel\n4. Discuss the consequences of placing synchronization inside divergent control flow\n5. Compare kernel-boundary synchronization with block-level synchronization\n\nFocus on correctness issues and common synchronization mistakes."}
{"question": "Explain warp execution and branch divergence in CUDA.\n\nYour answer should:\n1. Define a warp and explain how CUDA threads are grouped into warps\n2. Describe the SIMT execution model\n3. Explain what branch divergence is and when it occurs\n4. Analyze how divergence can affect execution efficiency\n5. Describe situations where conditional branches have little or no divergence penalty\n\nProvide conceptual examples without writing CUDA code."}
{"question": "Analyze CUDA occupancy and GPU resource utilization.\n\nYour answer should:\n1. Define occupancy in the context of CUDA\n2. Explain how registers, shared memory, threads per block, and hardware limits affect occupancy\n3. Explain why maximum occupancy does not always produce maximum performance\n4. Discuss the relationship between occupancy and latency hiding\n5. Describe how changing block size can influence resource utilization\n\nYour explanation should distinguish occupancy from overall GPU utilization."}
{"question": "Compare CUDA streams and asynchronous execution.\n\nYour answer should:\n1. Explain what a CUDA stream represents\n2. Describe ordering guarantees for operations within the same stream\n3. Explain how operations in different streams may overlap\n4. Discuss the conditions required for overlapping data transfers with kernel execution\n5. Compare synchronous and asynchronous memory transfers\n\nInclude a conceptual execution timeline showing how streams can improve throughput."}
{"question": "Analyze common CUDA memory transfer bottlenecks.\n\nYour answer should:\n1. Explain why CPU-GPU data transfers can become a performance bottleneck\n2. Compare pageable host memory and pinned host memory\n3. Explain the role of PCIe or other CPU-GPU interconnects\n4. Describe strategies for reducing unnecessary host-device transfers\n5. Discuss when unified memory may simplify programming and when it may introduce performance concerns\n\nFocus on performance reasoning rather than implementation details."}
{"question": "Explain atomic operations and race conditions in CUDA.\n\nYour answer should:\n1. Define a data race in massively parallel GPU execution\n2. Explain why multiple threads updating the same memory location can produce incorrect results\n3. Describe how atomic operations prevent certain race conditions\n4. Discuss the potential performance cost of heavy atomic contention\n5. Compare atomic operations with reduction-based approaches for parallel aggregation\n\nProvide conceptual examples such as counters, histograms, or reductions without source code."}
{"question": "Analyze floating-point numerical behavior in CUDA applications.\n\nYour answer should:\n1. Compare common properties of single-precision and double-precision floating-point computation\n2. Explain why parallel floating-point reductions may produce different results from sequential CPU reductions\n3. Discuss floating-point non-associativity\n4. Explain the trade-off between numerical precision and GPU performance\n5. Describe appropriate approaches for validating GPU results using absolute and relative tolerances\n\nFocus on numerical reasoning rather than CUDA implementation."}
{"question": "Explain how to diagnose CUDA performance problems using profiling information.\n\nYour answer should:\n1. Identify important metrics related to kernel execution time, memory bandwidth, occupancy, and compute utilization\n2. Explain how to determine whether a workload is memory-bound or compute-bound\n3. Describe signs of inefficient global memory access\n4. Explain how excessive synchronization or serialization can appear in performance analysis\n5. Propose a systematic process for identifying the main bottleneck before attempting optimization\n\nThe answer should focus on profiling methodology and performance interpretation rather than writing code."}
{"question": "Compare global memory, shared memory, and registers for data reuse in CUDA.\n\nYour answer should:\n1. Explain the visibility and lifetime of each memory type\n2. Discuss the relative performance characteristics of each memory type\n3. Explain how data reuse affects the choice of memory location\n4. Describe how excessive register usage can indirectly reduce performance\n5. Discuss when shared memory is preferable to repeated global memory accesses\n\nDo not provide implementation code."}
{"question": "Explain shared memory bank conflicts in CUDA.\n\nYour answer should:\n1. Describe how shared memory is divided into banks\n2. Explain how multiple threads in a warp can create bank conflicts\n3. Discuss how bank conflicts affect instruction throughput\n4. Distinguish bank conflicts from global memory coalescing problems\n5. Describe general data-layout strategies that can reduce bank conflicts\n\nUse conceptual examples rather than source code."}
{"question": "Analyze memory coalescing for row-major matrices.\n\nYour answer should:\n1. Explain row-major matrix storage\n2. Describe how adjacent threads should access matrix elements for efficient global memory transactions\n3. Explain why column-wise access can be inefficient for some thread mappings\n4. Discuss how matrix dimensions and alignment can influence access efficiency\n5. Compare the behavior of contiguous and strided access patterns\n\nFocus on memory-access reasoning."}
{"question": "Explain the purpose of tiling in CUDA matrix operations.\n\nYour answer should:\n1. Define tiling in the context of GPU computation\n2. Explain how tiling improves data reuse\n3. Describe the relationship between tile size and shared memory usage\n4. Discuss how tile size can affect occupancy\n5. Explain why boundary tiles require special handling\n\nDo not write a tiled kernel."}
{"question": "Analyze the trade-offs involved in selecting CUDA block dimensions.\n\nYour answer should:\n1. Explain hardware limits on threads per block\n2. Discuss the importance of warp-sized groupings\n3. Explain how block dimensions affect occupancy and scheduling\n4. Describe how multidimensional block shapes can influence memory access patterns\n5. Explain why the largest legal block is not necessarily the fastest\n\nProvide performance-oriented reasoning."}
{"question": "Explain latency hiding in CUDA.\n\nYour answer should:\n1. Define instruction and memory latency\n2. Explain how warp scheduling helps hide latency\n3. Describe the role of having multiple active warps\n4. Discuss how dependencies within a warp can limit latency hiding\n5. Explain why sufficient parallelism is important for GPU performance\n\nUse a conceptual scheduling example."}
{"question": "Compare CPU and GPU execution models.\n\nYour answer should:\n1. Contrast latency-oriented CPU design with throughput-oriented GPU design\n2. Explain why GPUs use many lightweight threads\n3. Discuss differences in control-flow handling\n4. Compare memory hierarchy design goals\n5. Identify workload characteristics that favor GPU acceleration\n\nDo not provide programming examples."}
{"question": "Explain why some workloads achieve poor speedup on GPUs.\n\nYour answer should:\n1. Discuss insufficient parallelism\n2. Explain the cost of host-device communication\n3. Describe the effect of branch-heavy workloads\n4. Explain how irregular memory access can reduce performance\n5. Discuss the role of problem size and kernel launch overhead\n\nProvide a structured performance analysis."}
{"question": "Analyze kernel launch overhead in CUDA.\n\nYour answer should:\n1. Explain what kernel launch overhead represents\n2. Discuss why many tiny kernels can be inefficient\n3. Explain how launch overhead interacts with small problem sizes\n4. Describe how batching or fusion can reduce overhead\n5. Discuss when kernel fusion may create new resource-pressure trade-offs\n\nFocus on high-level optimization reasoning."}
{"question": "Explain the concept of kernel fusion in CUDA.\n\nYour answer should:\n1. Define kernel fusion\n2. Explain how fusion can reduce intermediate global memory traffic\n3. Discuss how fusion can reduce kernel launch overhead\n4. Describe how fusion can increase register pressure or complexity\n5. Explain when separate kernels may still be preferable\n\nDo not implement a fused kernel."}
{"question": "Compare explicit device memory management with unified memory.\n\nYour answer should:\n1. Explain the programming model of each approach\n2. Discuss data movement responsibilities\n3. Explain page migration at a high level\n4. Describe situations where unified memory can cause unpredictable performance\n5. Discuss scenarios where unified memory is especially convenient\n\nFocus on conceptual trade-offs."}
{"question": "Explain CUDA page migration and page faults under unified memory.\n\nYour answer should:\n1. Describe why managed pages may migrate between CPU and GPU\n2. Explain what can trigger a GPU page fault\n3. Discuss how repeated migration can hurt performance\n4. Describe the concept of data locality in managed memory\n5. Explain how access patterns influence migration behavior\n\nDo not provide API calls or source code."}
{"question": "Analyze the role of pinned host memory in CUDA data transfers.\n\nYour answer should:\n1. Define pinned host memory\n2. Explain why it can improve transfer performance\n3. Discuss its relationship with asynchronous copies\n4. Explain potential disadvantages of allocating too much pinned memory\n5. Compare it conceptually with ordinary pageable memory\n\nFocus on system-level behavior."}
{"question": "Explain asynchronous execution dependencies in CUDA.\n\nYour answer should:\n1. Describe why asynchronous operations may complete later than the host call that launches them\n2. Explain dependencies within a single stream\n3. Discuss dependencies across multiple streams\n4. Explain the purpose of event-based coordination conceptually\n5. Describe a correctness problem that can occur when dependencies are omitted\n\nDo not write event-management code."}
{"question": "Analyze the difference between concurrency and parallelism in CUDA.\n\nYour answer should:\n1. Define concurrency and parallelism\n2. Explain how multiple kernels may execute concurrently\n3. Discuss how copy engines may overlap transfers with computation\n4. Explain why hardware resource limits can prevent expected overlap\n5. Describe how timelines can be used to distinguish concurrency from serialization\n\nUse conceptual examples."}
{"question": "Explain CUDA event timing and performance measurement.\n\nYour answer should:\n1. Describe why ordinary CPU wall-clock timing may be misleading for asynchronous GPU work\n2. Explain conceptually how GPU events can measure elapsed device time\n3. Discuss the need for appropriate synchronization when measuring work\n4. Explain why warm-up iterations can matter\n5. Describe how to report stable performance measurements\n\nDo not provide timing code."}
{"question": "Analyze arithmetic intensity in GPU workloads.\n\nYour answer should:\n1. Define arithmetic intensity\n2. Explain its relationship to computation and memory traffic\n3. Describe characteristics of memory-bound workloads\n4. Describe characteristics of compute-bound workloads\n5. Explain how increasing data reuse can change arithmetic intensity\n\nUse a simple numerical example if helpful."}
{"question": "Explain the roofline performance model for CUDA workloads.\n\nYour answer should:\n1. Define peak compute throughput and peak memory bandwidth\n2. Explain the concept of arithmetic intensity\n3. Describe the memory-bound and compute-bound regions of a roofline model\n4. Explain how measured performance can be interpreted relative to the roofline\n5. Discuss limitations of using the model as a complete performance diagnosis\n\nDo not generate plots or code."}
{"question": "Analyze reduction operations on GPUs.\n\nYour answer should:\n1. Explain why reductions require combining many values into fewer outputs\n2. Describe why naive global serialization performs poorly\n3. Explain the concept of hierarchical reduction\n4. Discuss synchronization needs within partial reductions\n5. Explain why floating-point reduction order may affect results\n\nFocus on parallel algorithm design without writing code."}
{"question": "Explain prefix sum, also known as scan, in the context of CUDA.\n\nYour answer should:\n1. Define inclusive and exclusive scan\n2. Explain why scan is more complex than element-wise parallel operations\n3. Describe the need for inter-thread data dependencies\n4. Discuss applications such as compaction, sorting, and indexing\n5. Explain why efficient GPU scan algorithms use hierarchical organization\n\nDo not provide an implementation."}
{"question": "Analyze histogram computation on a GPU.\n\nYour answer should:\n1. Explain why histogram updates can create contention\n2. Describe the role of atomic operations\n3. Explain how privatization can reduce contention\n4. Discuss trade-offs between shared-memory and global-memory accumulation\n5. Explain how input distribution can affect performance\n\nProvide conceptual analysis only."}
{"question": "Explain sparse versus dense data processing on GPUs.\n\nYour answer should:\n1. Describe the difference between dense and sparse data structures\n2. Explain why sparse access patterns can reduce memory efficiency\n3. Discuss load imbalance in sparse workloads\n4. Explain how sparsity can reduce unnecessary computation\n5. Describe factors that determine whether sparse GPU processing is effective\n\nDo not discuss implementation syntax."}
{"question": "Analyze load imbalance in CUDA workloads.\n\nYour answer should:\n1. Define load imbalance among GPU threads or warps\n2. Explain how uneven work distribution affects utilization\n3. Discuss irregular input sizes and data-dependent workloads\n4. Explain the relationship between load imbalance and warp divergence\n5. Describe high-level strategies for balancing work more evenly\n\nFocus on performance concepts."}
{"question": "Explain warp-level execution efficiency.\n\nYour answer should:\n1. Describe active and inactive lanes within a warp\n2. Explain how divergence can reduce the fraction of useful work\n3. Discuss partial warps at problem boundaries\n4. Explain why block sizes that are not multiples of the warp size may waste execution lanes\n5. Describe how profiling metrics can reveal inefficient warp execution\n\nDo not provide CUDA code."}
{"question": "Analyze register pressure in CUDA kernels.\n\nYour answer should:\n1. Explain what per-thread registers are used for\n2. Describe how high register usage can reduce the number of resident warps\n3. Explain the concept of register spilling\n4. Discuss why spilling may generate additional memory traffic\n5. Explain the trade-off between using more registers and increasing occupancy\n\nProvide conceptual performance reasoning."}
{"question": "Explain local memory in CUDA.\n\nYour answer should:\n1. Clarify why local memory is private to a thread but may reside in device memory\n2. Describe situations that can cause values to be placed in local memory\n3. Explain the performance consequences of local memory accesses\n4. Discuss the relationship between register pressure and local memory\n5. Compare local memory with registers and shared memory\n\nAvoid implementation-specific code."}
{"question": "Analyze constant memory usage in CUDA.\n\nYour answer should:\n1. Explain the purpose of constant memory\n2. Describe its read-only nature from the device perspective\n3. Explain broadcast behavior when threads read the same address\n4. Discuss cases where different addresses within a warp may reduce efficiency\n5. Identify workload patterns that are well suited to constant memory\n\nDo not provide API examples."}
{"question": "Explain texture or read-only caching concepts in GPU workloads.\n\nYour answer should:\n1. Describe why specialized caches can benefit read-heavy workloads\n2. Explain the importance of spatial locality\n3. Discuss how irregular read access may behave differently from linear access\n4. Compare cached read paths conceptually with uncached global memory traffic\n5. Identify types of workloads that may benefit from read-optimized caching\n\nFocus on concepts rather than syntax."}
{"question": "Analyze error handling in CUDA applications.\n\nYour answer should:\n1. Explain why asynchronous execution can delay the visibility of errors\n2. Distinguish launch-time errors from execution-time errors conceptually\n3. Discuss why checking errors only at program termination is insufficient\n4. Explain the role of synchronization during debugging\n5. Describe a systematic strategy for locating the operation that first caused a failure\n\nDo not provide error-checking code."}
{"question": "Explain illegal memory access errors in CUDA.\n\nYour answer should:\n1. Describe common causes of out-of-bounds device memory accesses\n2. Explain how incorrect thread indexing can lead to invalid addresses\n3. Discuss lifetime and allocation-size mistakes\n4. Explain why the reported failure may appear after the offending kernel launch\n5. Describe a debugging process for narrowing down the cause\n\nDo not provide source code."}
{"question": "Analyze race conditions involving shared memory.\n\nYour answer should:\n1. Explain how multiple threads can read and write shared memory concurrently\n2. Describe a read-after-write hazard\n3. Describe a write-after-write hazard\n4. Explain when synchronization is required for correctness\n5. Discuss why synchronization alone does not fix logically conflicting writes\n\nUse conceptual examples only."}
{"question": "Explain deterministic and nondeterministic behavior in CUDA programs.\n\nYour answer should:\n1. Define deterministic output\n2. Explain how race conditions can produce nondeterministic results\n3. Discuss why floating-point atomic operations can lead to order-dependent results\n4. Explain why nondeterminism does not always imply a correctness bug\n5. Describe appropriate validation strategies for numerically nondeterministic computations\n\nFocus on reasoning rather than implementation."}
{"question": "Analyze GPU-friendly data layouts.\n\nYour answer should:\n1. Compare array-of-structures and structure-of-arrays layouts\n2. Explain how each layout affects adjacent-thread memory accesses\n3. Discuss the importance of alignment and stride\n4. Explain why data layout can influence cache and bandwidth efficiency\n5. Identify workload characteristics that may favor one layout over the other\n\nDo not write conversion code."}
{"question": "Explain alignment and memory transaction efficiency in CUDA.\n\nYour answer should:\n1. Define memory alignment at a high level\n2. Explain why aligned contiguous accesses are generally efficient\n3. Discuss how misalignment can increase the number of memory transactions\n4. Explain the interaction between element size and access pattern\n5. Describe why alignment considerations matter more in bandwidth-sensitive workloads\n\nProvide conceptual examples."}
{"question": "Analyze the performance implications of strided memory access.\n\nYour answer should:\n1. Define a strided access pattern\n2. Explain how stride affects memory coalescing\n3. Discuss the impact on cache utilization\n4. Compare small and large strides conceptually\n5. Describe algorithmic situations where strided access naturally occurs\n\nDo not provide CUDA source code."}
{"question": "Explain boundary handling in CUDA kernels from a correctness and performance perspective.\n\nYour answer should:\n1. Explain why extra threads are often launched beyond the logical problem size\n2. Describe the purpose of bounds checks\n3. Discuss how boundary branches can create partial warp activity\n4. Explain why the performance cost is usually localized to edge warps\n5. Describe common indexing mistakes that cause boundary errors\n\nFocus on general principles."}
{"question": "Analyze matrix transpose performance on a GPU.\n\nYour answer should:\n1. Explain why a naive transpose can have unfavorable global memory access patterns\n2. Describe how one dimension may have coalesced reads but strided writes\n3. Explain how shared-memory tiling can conceptually improve access efficiency\n4. Discuss the possibility of shared-memory bank conflicts\n5. Explain why padding may help in tiled transpose designs\n\nDo not write a transpose kernel."}
{"question": "Explain the performance characteristics of matrix multiplication on GPUs.\n\nYour answer should:\n1. Describe why matrix multiplication has high data reuse potential\n2. Explain how tiling can reduce global memory traffic\n3. Discuss arithmetic intensity\n4. Explain how tensor-oriented hardware may accelerate suitable operations\n5. Describe why matrix size and tile selection influence achieved performance\n\nFocus on architectural reasoning."}
{"question": "Analyze the difference between memory bandwidth and memory latency.\n\nYour answer should:\n1. Define bandwidth and latency separately\n2. Explain why a workload can be latency-limited even when peak bandwidth is high\n3. Discuss how coalescing affects effective bandwidth\n4. Explain how many concurrent memory requests can hide latency\n5. Give examples of workloads dominated by each factor\n\nDo not provide source code."}
{"question": "Explain scalability limits in CUDA applications.\n\nYour answer should:\n1. Discuss limits imposed by available parallelism\n2. Explain how serial work can constrain overall speedup\n3. Describe the impact of communication and synchronization overhead\n4. Discuss memory bandwidth as a scaling bottleneck\n5. Explain why performance may stop improving as more GPU resources become available\n\nUse general parallel-computing principles and GPU-specific reasoning."}