0
0
MLOpsdevops~20 mins

Model optimization for serving (quantization, pruning) in MLOps - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Model Optimization Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Quantization Impact

Which of the following best describes the main benefit of quantization in model serving?

AIt increases model accuracy by adding more layers.
BIt removes unnecessary neurons to simplify the model architecture.
CIt converts the model to a different programming language for compatibility.
DIt reduces model size and speeds up inference by using lower precision numbers.
Attempts:
2 left
💡 Hint

Think about how using smaller numbers affects memory and speed.

💻 Command Output
intermediate
2:00remaining
Output of Pruning Command

What is the expected output after running this pruning command on a TensorFlow model?

MLOps
tfmot.sparsity.keras.prune_low_magnitude(model, pruning_schedule=tfmot.sparsity.keras.PolynomialDecay(initial_sparsity=0.0, final_sparsity=0.5, begin_step=0, end_step=1000))
AA pruned model with approximately 50% of weights set to zero after 1000 steps.
BA model converted to 8-bit integers for faster inference.
CAn error because pruning requires a different API call.
DA model with all weights doubled in magnitude.
Attempts:
2 left
💡 Hint

Pruning gradually removes weights by setting them to zero based on magnitude.

🔀 Workflow
advanced
3:00remaining
Correct Sequence for Model Quantization Workflow

Arrange the steps in the correct order to perform post-training quantization for a TensorFlow model.

A2,1,3,4
B1,2,3,4
C1,3,2,4
D1,2,4,3
Attempts:
2 left
💡 Hint

Think about loading first, then converting, saving, and finally testing.

Troubleshoot
advanced
2:00remaining
Troubleshooting Accuracy Drop After Pruning

After pruning a model, you notice a significant drop in accuracy. Which option is the most likely cause?

AThe pruning API was not called, so the model was unchanged.
BThe model was quantized instead of pruned, causing precision loss.
CThe pruning sparsity was set too high too quickly, removing important weights.
DThe model was trained with too many epochs before pruning.
Attempts:
2 left
💡 Hint

Consider how pruning speed and amount affect model quality.

Best Practice
expert
3:00remaining
Best Practice for Combining Quantization and Pruning

Which practice is recommended when combining pruning and quantization to optimize a model for serving?

AFirst prune the model to reduce weights, then fine-tune it, and finally apply quantization.
BApply quantization first, then prune the quantized model without retraining.
CPrune and quantize simultaneously without any fine-tuning steps.
DOnly prune the model; quantization is not compatible with pruning.
Attempts:
2 left
💡 Hint

Think about the order that preserves accuracy and model size reduction.