179 questions
No questions match those filters.
← All questions
Inference & ServingMedium· Kernel Fusion· PyTorch· Profiling
A custom activation function written as a chain of PyTo...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansFirst, verify via the profiler trace that the activation is executing as multiple separate kernels. The primary optimization strategy is to apply torch.compile, which can automatically fuse simple chains into a single Triton kernel. If the operation requires more complex logic, such as custom shared memory layouts or specific masking, you should manually implement a Triton kernel. Always profile after each modification to confirm that the kernel launch count has decreased.