[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"me":3,"catalog:en:ai-engineer\u002Faipy-gpu-memory-management":4,"config":193},null,{"field_key":5,"field_name":6,"seniority":7,"topic_key":8,"topic_name":9,"spec_key":7,"spec_name":7,"locale":10,"cell_total":11,"field_total":12,"seniorities":13,"topics":17,"specs":97,"samples":108},"ai-engineer","AI Engineer","","aipy-gpu-memory-management","Aipy Gpu Memory Management","en",75,2025,[14,15,16],"junior","mid","senior",[18,21,24,27,30,33,36,39,42,45,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94],{"key":19,"name":20,"count":11},"agents-tool-use","Agents Tool Use",{"key":22,"name":23,"count":11},"aimlops-deployment-strategies-ml","Aimlops Deployment Strategies Ml",{"key":25,"name":26,"count":11},"aimlops-experiment-tracking-reproducibility","Aimlops Experiment Tracking Reproducibility",{"key":28,"name":29,"count":11},"aimlops-feature-store-data-versioning","Aimlops Feature Store Data Versioning",{"key":31,"name":32,"count":11},"aimlops-ml-cicd-pipelines","Aimlops Ml Cicd Pipelines",{"key":34,"name":35,"count":11},"aimlops-model-monitoring-drift-detection","Aimlops Model Monitoring Drift Detection",{"key":37,"name":38,"count":11},"aimlops-model-versioning-registry","Aimlops Model Versioning Registry",{"key":40,"name":41,"count":11},"aipy-async-concurrency-ml-serving","Aipy Async Concurrency Ml Serving",{"key":43,"name":44,"count":11},"aipy-data-pipeline-dataloader","Aipy Data Pipeline Dataloader",{"key":8,"name":9,"count":11},{"key":47,"name":48,"count":11},"aipy-numpy-vectorization-broadcasting","Aipy Numpy Vectorization Broadcasting",{"key":50,"name":51,"count":11},"aipy-python-ml-packaging-environments","Aipy Python Ml Packaging Environments",{"key":53,"name":54,"count":11},"aipy-tensor-ops-autograd","Aipy Tensor Ops Autograd",{"key":56,"name":57,"count":11},"embeddings-vector-search","Embeddings Vector Search",{"key":59,"name":60,"count":11},"evaluation-testing","Evaluation Testing",{"key":62,"name":63,"count":11},"fine-tuning-adaptation","Fine Tuning Adaptation",{"key":65,"name":66,"count":11},"inference-serving","Inference Serving",{"key":68,"name":69,"count":11},"llm-fundamentals","Llm Fundamentals",{"key":71,"name":72,"count":11},"prompt-engineering","Prompt Engineering",{"key":74,"name":75,"count":11},"rag-chunking-indexing","Rag Chunking Indexing",{"key":77,"name":78,"count":11},"rag-embeddings-similarity","Rag Embeddings Similarity",{"key":80,"name":81,"count":11},"rag-evaluation","Rag Evaluation",{"key":83,"name":84,"count":11},"rag-generation-context","Rag Generation Context",{"key":86,"name":87,"count":11},"rag-reranking-fusion","Rag Reranking Fusion",{"key":89,"name":90,"count":11},"rag-retrieval","Rag Retrieval",{"key":92,"name":93,"count":11},"rag-retrieval-search","Rag Retrieval Search",{"key":95,"name":96,"count":11},"safety-guardrails","Safety Guardrails",[98,102,105],{"key":99,"name":100,"count":101},"llm-rag","LLM\u002FRAG",450,{"key":103,"name":104,"count":101},"mlops","MLOps",{"key":106,"name":107,"count":101},"python","Python",[109,127,141,154,167,180],{"id":110,"topic":9,"difficulty":111,"body":112,"options":113,"correct_key":118,"explanation":126},"019f9407-fc8c-7c49-8c2f-2b70d5499b03",1,"When a PyTorch training script raises `CUDA out of memory`, what does this error most directly indicate?",[114,117,120,123],{"key":115,"text":116},"a","The Python process ran out of regular (host) RAM, not GPU memory.",{"key":118,"text":119},"b","The GPU could not allocate the requested block of device memory for a tensor or operation.",{"key":121,"text":122},"c","The CUDA driver version is incompatible with the installed PyTorch build. This can sound plausible since driver mismatches are also reported at startup, but the wording and context differ from an allocation failure.",{"key":124,"text":125},"d","The model's weights file on disk is corrupted and failed to load.","`CUDA out of memory` is raised when the CUDA memory allocator cannot satisfy a request for GPU device memory, because the GPU's memory is already occupied by other tensors (weights, activations, gradients, optimizer state, cached blocks). (a) describes a host-RAM error, which raises a different exception. (c) and (d) describe unrelated failure modes (driver mismatch, corrupted checkpoint) that produce different error messages.",{"id":128,"topic":9,"difficulty":129,"body":130,"options":131,"correct_key":115,"explanation":140},"019f9407-fc94-7736-bf16-64bd3a21a1ec",2,"A team trains an image classifier and hits `CUDA out of memory` only when they increase `batch_size` from 32 to 128, with everything else unchanged. What is the most likely reason?",[132,134,136,138],{"key":115,"text":133},"Activation memory scales roughly linearly with batch size, so a 4x larger batch needs roughly 4x more activation memory.",{"key":118,"text":135},"Larger batch sizes force PyTorch to store the model weights in a higher-precision format. Teams sometimes reach for this explanation because precision and memory both sound related to 'how big' a tensor is.",{"key":121,"text":137},"The optimizer creates a separate copy of the model for every sample in the batch.",{"key":124,"text":139},"Batch size only affects how many gradient updates occur per epoch, not memory usage.","For most architectures, per-layer activations are stored per sample in the batch, so total activation memory grows roughly linearly with batch size, while the memory used by the model weights themselves stays constant. (b) and (c) invent mechanisms that don't reflect how batch size affects memory. (d) is wrong because batch size directly affects memory pressure, not just update frequency.",{"id":142,"topic":9,"difficulty":129,"body":143,"options":144,"correct_key":121,"explanation":153},"019f9407-fc96-7441-85e4-2897d21c15ba","After a `CUDA out of memory` error, a developer calls `torch.cuda.empty_cache()` hoping to fix the underlying problem and retries the same batch size. What actually happens?",[145,147,149,151],{"key":115,"text":146},"It permanently increases the total GPU memory available to the process.",{"key":118,"text":148},"It frees the memory still held by tensors that are currently referenced by Python variables. This would actually be dangerous if true, since it would silently corrupt a running computation, which is not what this call does.",{"key":121,"text":150},"It returns currently unused, cached memory blocks back to the CUDA driver, but does not free memory still in use, so the same OOM can recur.",{"key":124,"text":152},"It compresses all tensors currently on the GPU to reduce their memory footprint.","`empty_cache()` only releases memory blocks that PyTorch's caching allocator is holding but not currently using back to the CUDA driver; it cannot touch memory still referenced by live tensors, and it does not add new physical memory. If the batch genuinely needs more memory than the GPU has, the same error will happen again. (a) and (d) describe capabilities this call does not have. (b) misdescribes it as freeing live, referenced memory, which would break correctness.",{"id":155,"topic":9,"difficulty":111,"body":156,"options":157,"correct_key":115,"explanation":166},"019f9407-fc97-7e50-8dbd-0f54814e1208","Training a model in fp16 or bf16 mixed precision instead of full fp32, roughly how does the memory needed to store weight and activation tensors change?",[158,160,162,164],{"key":115,"text":159},"It is roughly halved, since each value uses 2 bytes instead of 4.",{"key":118,"text":161},"It roughly doubles, since two values are now needed to represent each original number.",{"key":121,"text":163},"It stays exactly the same, since precision only affects numerical accuracy, not storage size.",{"key":124,"text":165},"It depends only on batch size, not on the numeric format used. This sounds intuitive if you assume memory tracking is tied to computation speed rather than to the numeric format's byte width.","fp16 and bf16 both use 2 bytes per value versus fp32's 4 bytes, so tensors stored in these formats roughly halve their memory footprint compared to the same tensor in fp32. (b) inverts the direction. (c) and (d) deny that numeric format affects storage size, which contradicts how these dtypes are defined.",{"id":168,"topic":9,"difficulty":129,"body":169,"options":170,"correct_key":124,"explanation":179},"019f9407-fc9e-70bb-bd04-73f471992e95","Gradient checkpointing is enabled on a model that was previously running out of GPU memory during the backward pass. What trade-off does this technique make?",[171,173,175,177],{"key":115,"text":172},"It reduces the number of training steps needed, at the cost of lower final accuracy.",{"key":118,"text":174},"It reduces memory by permanently deleting a fraction of the model's layers. This might seem plausible if pruning is confused with a memory-saving technique, but checkpointing never removes layers.",{"key":121,"text":176},"It reduces memory by storing all activations in host RAM instead of GPU memory.",{"key":124,"text":178},"It reduces memory by not storing most intermediate activations, recomputing them during the backward pass instead, at the cost of extra compute time.","Gradient checkpointing avoids storing most forward-pass activations; during backpropagation, it recomputes those activations from the last stored checkpoint, trading additional forward-pass compute for lower peak memory. (a) and (b) describe unrelated or destructive changes checkpointing does not make. (c) confuses it with CPU\u002Factivation offloading, a different technique.",{"id":181,"topic":9,"difficulty":129,"body":182,"options":183,"correct_key":118,"explanation":192},"019f9407-fc9f-7b89-bd89-cfed834e20a5","In the context of GPU memory, what does 'memory fragmentation' refer to?",[184,186,188,190],{"key":115,"text":185},"The GPU's total memory capacity being physically divided across multiple chips. Physical chip layout is a real hardware detail, but it is unrelated to how the allocator tracks free and used regions of memory.",{"key":118,"text":187},"Free memory existing in many small, non-contiguous blocks, so a large-enough single allocation can fail even though the total free memory is sufficient.",{"key":121,"text":189},"A model's weights being split into shards for distributed training.",{"key":124,"text":191},"The gradual corruption of tensor values due to repeated fp16 rounding.","Fragmentation happens when memory frees and allocates over time in a way that leaves free space scattered in small non-contiguous chunks; even if their sum is large enough, no single chunk may be big enough for a new large allocation. (a) and (c) describe unrelated hardware\u002Fparallelism concepts. (d) describes numerical precision drift, not a memory layout issue.",{"fields":194,"seniorities":372,"interview_shapes":373,"locales":378,"oauth":380,"question_count":383,"coach_enabled":384,"jd_match_enabled":384},[195,218,238,255,279,286,305,324,346,353,359,366],{"key":196,"name_tr":197,"name_en":197,"sort":111,"specializations":198},"backend","Backend",[199,202,205,206,209,212,215],{"key":200,"name":201,"field":196},"general","Genel",{"key":203,"name":204,"field":196},"go","Go",{"key":106,"name":107,"field":196},{"key":207,"name":208,"field":196},"java","Java",{"key":210,"name":211,"field":196},"csharp","C#\u002F.NET",{"key":213,"name":214,"field":196},"nodejs","Node.js",{"key":216,"name":217,"field":196},"php","PHP",{"key":219,"name_tr":220,"name_en":220,"sort":129,"specializations":221},"frontend","Frontend",[222,223,226,229,232,235],{"key":200,"name":201,"field":219},{"key":224,"name":225,"field":219},"javascript","JavaScript",{"key":227,"name":228,"field":219},"typescript","TypeScript",{"key":230,"name":231,"field":219},"react","React",{"key":233,"name":234,"field":219},"vue","Vue",{"key":236,"name":237,"field":219},"angular","Angular",{"key":239,"name_tr":240,"name_en":240,"sort":241,"specializations":242},"fullstack","Fullstack",3,[243,244,245,246,247,248,249,250,251,252,253,254],{"key":200,"name":201,"field":239},{"key":203,"name":204,"field":196},{"key":106,"name":107,"field":196},{"key":207,"name":208,"field":196},{"key":210,"name":211,"field":196},{"key":213,"name":214,"field":196},{"key":216,"name":217,"field":196},{"key":224,"name":225,"field":219},{"key":227,"name":228,"field":219},{"key":230,"name":231,"field":219},{"key":233,"name":234,"field":219},{"key":236,"name":237,"field":219},{"key":256,"name_tr":257,"name_en":257,"sort":258,"specializations":259},"devops-cloud","DevOps \u002F Cloud",4,[260,261,264,267,270,273,276],{"key":200,"name":201,"field":256},{"key":262,"name":263,"field":256},"aws","AWS",{"key":265,"name":266,"field":256},"gcp","GCP",{"key":268,"name":269,"field":256},"azure","Azure",{"key":271,"name":272,"field":256},"kubernetes","Kubernetes",{"key":274,"name":275,"field":256},"terraform","Terraform",{"key":277,"name":278,"field":256},"linux","Linux",{"key":5,"name_tr":6,"name_en":6,"sort":280,"specializations":281},5,[282,283,284,285],{"key":200,"name":201,"field":5},{"key":106,"name":107,"field":5},{"key":99,"name":100,"field":5},{"key":103,"name":104,"field":5},{"key":287,"name_tr":288,"name_en":289,"sort":290,"specializations":291},"database","Veritabanı","Database",6,[292,293,296,299,302],{"key":200,"name":201,"field":287},{"key":294,"name":295,"field":287},"postgresql","PostgreSQL",{"key":297,"name":298,"field":287},"mysql","MySQL",{"key":300,"name":301,"field":287},"mongodb","MongoDB",{"key":303,"name":304,"field":287},"redis","Redis",{"key":306,"name_tr":307,"name_en":308,"sort":309,"specializations":310},"mobile","Mobil","Mobile",7,[311,312,315,318,321],{"key":200,"name":201,"field":306},{"key":313,"name":314,"field":306},"ios-swift","iOS (Swift)",{"key":316,"name":317,"field":306},"android-kotlin","Android (Kotlin)",{"key":319,"name":320,"field":306},"flutter","Flutter",{"key":322,"name":323,"field":306},"react-native","React Native",{"key":325,"name_tr":326,"name_en":327,"sort":328,"specializations":329},"security","Güvenlik","Security",8,[330,331,334,337,340,343],{"key":200,"name":201,"field":325},{"key":332,"name":333,"field":325},"appsec","AppSec",{"key":335,"name":336,"field":325},"offensive-pentest","Offensive \u002F Pentest",{"key":338,"name":339,"field":325},"cloud-security","Cloud Security",{"key":341,"name":342,"field":325},"devsecops","DevSecOps",{"key":344,"name":345,"field":325},"blue-team-incident","Blue Team \u002F Incident",{"key":347,"name_tr":348,"name_en":349,"sort":350,"specializations":351},"qa-test-automation","QA \u002F Test Otomasyonu","QA \u002F Test Automation",9,[352],{"key":200,"name":201,"field":347},{"key":354,"name_tr":355,"name_en":355,"sort":356,"specializations":357},"data-engineer","Data Engineer",10,[358],{"key":200,"name":201,"field":354},{"key":360,"name_tr":361,"name_en":362,"sort":363,"specializations":364},"game-dev","Oyun Geliştirme","Game Development",11,[365],{"key":200,"name":201,"field":360},{"key":367,"name_tr":368,"name_en":368,"sort":369,"specializations":370},"ml-engineer","ML Engineer",12,[371],{"key":200,"name":201,"field":367},[14,15,16],{"junior":374,"mid":376,"senior":377},{"questions":375,"median_sec":3},20,{"questions":375,"median_sec":3},{"questions":375,"median_sec":3},[379,10],"tr",[381,382],"google","github",21750,true]