It is not they way the 35-year-old will have wanted to progress in Indian Wells as fans were denied a potential blockbusting clash with the Australian, who beat world number two Novak Djokovic in the previous round.
But Kyrgios was struck down by food poisoning and unable to take to court.
"Unfortunately I am unable to play today due to sickness," Kyrgios wrote in a statement posted to his Twitter feed. "At this stage we think it's food poisoning, and I'm praying it's nothing more.
"After a restless night of being sick I have nothing left and to play a great champion like Roger, I need to be at my best to have a chance.
"I don't take this decision lightly, these are the matches we train for but I'm in no fit state to take to the court. I'm sorry to the fans but I have to put my health first and I hope you understand.
"I want to wish Roger the best of luck for the rest of the tournament and thank everyone for their support so far here at the BNP Paribas Open. I will definitely be back. Thank you."
Federer, who defeated great rival Rafael Nadal in the previous round, posted on Twitter: "Hope you feel better NickKyrgios."
Federer will meet Jack Sock in the last four after the American reached his first Masters 1000 semi-final by beating Kei Nishikori.
The 24-year-old won 6-3 2-6 6-2 to record the first victory over a top five player.
Stan Wawrinka meets Pablo Carreno Busta in the other semi-final.Reuse content