Impact of a W for grad school if I'm changing majors?
In general, no single thing like this would have much impact. In this case, I'd say even less. People aren't looking for small reasons to reject your application, but for evidence that you will be a success in your chosen field as well as in the program you apply to. 

So, if you do well overall and do especially well in Philosophy then you should be fine. Good letters of recommendation will overcome a simple thing like a W. 

But be prepared, if asked, to talk about why you wanted to switch. And make the reasons positive, about philosophy, not negative about math or CS.