akankshakshurai/cuda-error-resolution-analysis huggingface dataset:
IG & KernelShap do not add up to prediction?

bko: <p>Hi,</p>
<p>Thanks so much for putting together such a great tool. <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=12" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"> So I am trying to use integrated gradients and SHAP on a complicated model, and my feature importance scores do not seem to add up to the model output. However, they can be rescaled to add up to the model output.</p>
<p>The model is a causal inference model with multiple inputs and outputs. At the very end, I create a wrapper to output a single quantity, the treatment effect. I’ve got complete code in this <a href="https://colab.research.google.com/drive/1lG61QUBaCQuuWDWS94D5Ldygxzuso5zt?usp=sharing" rel="noopener nofollow ugc">notebook</a>.</p>
<p>Do you have any idea why this might be happening? Am I picking the wrong baseline?</p>
<p>Thanks for your help; I really appreciate it!</p>
Getting number of samples in distributed data loader

lukasz-staniszewski: <p>Is there any easy way to access number of samples that are returned by specific process’ dataloader (which is distributed for multi-gpu training)?</p>
<p>I am training model using <code>torch.dist</code> with multiple GPUs and need to get number of examples in dataloader (that is distributed using <code>torch.utils.data.distributed.DistributedSampler</code>) per rank. I can’t use <code>len(dataloader)</code> because I will get number of batches per rank and when I use <code>len(dataloader.dataset)</code> I will get size of whole dataset (so number of examples that are in total among all ranks).</p>

H-Huang: <p>Can you do something like:</p>
<pre><code class="lang-python">sampler = DistributedSampler(dataset)
num_samples = len(sampler) // dist.get_world_size()
</code></pre>