If a grant contributes to your specific work, acknowledge it. If a PI contributes to your specific work, acknowledge him/her at some appropriate level. But if your work is split, then you don't need to merge them mentally or otherwise.
But, I think the best way to handle this is not to make your now decision or take any advice here, but to talk to the two PIs and see what they recommend.
Any person or funding agency without whom/which you can't succeed is probably worthy of acknowledgement. For the agencies it is an easier question, especially if they are providing your salary and living expenses. For the professors, it depends more on the nature of your project(s).
In edge cases it is probably better to acknowledge people, or even include them as co-authors just to build academic comity and to keep people in your academic circle for a lifetime.
Your work as a doctoral student will be your first major work, not your last or only work. Hopefully it won't even be your best work. Build for the future.
I also note that co-authorship of PI's is a field-dependent issue. In some it is essentially required. In others, just not done. I was never co-author with any of my students on their doctoral work, nor was my advisor one of my co-authors.