Federer booked his place with a straight-sets defeat of Rafael Nadal in a follow-up to the Australian Open final
, while Kyrgios beat world no. 2 Novak Djokovic for the second time in three weeks.
Australian Kyrgios, who won 6-4 7-6 (7-3), has something of a bad-boy reputation on the circuit, but against Federer he will be aiming to make his third consecutive ATP Tour semifinal.
Kyrgios was fined and banned
for eight weeks by the ATP World Tour for failing to "give best efforts" in Shanghai in October, and he crashed out of the Australian Open
in the second round in what was tagged a "bizarre" performance.
But the 21-year-old's second win against Djokovic, after victory in the quarterfinals of the Mexican Open, suggests he could have turned a corner.
"I'm very impressed him taking out Novak, back-to-back weeks, on Novak's best surface," said Federer, who won his 18th grand slam title in Melbourne in January at the age of 35.
"I hope it's going to lead to something great for Nick, that he realizes if he puts his head down and focuses that he can bring it, day in and day out, week in and week out."
The pair has only met once before, when Kyrgios beat Federer at the Madrid Masters in 2015.
Djokovic had been imperious at the BNP Paribas Open, winning the last three titles and racking up a 19-match winning streak.
But he struggled to cope with the speed and accuracy of the Kyrgios serve -- the Australian hit 14 aces and fired a 141 mph rocket in the process.
At one point, Djokovic cracked his racquet on the ground in frustration.
"The run was amazing. I am very proud of it, obviously," said the Serb
. "It had to end at some stage. Unfortunately, it was today.
"He obviously comes out playing his style, very aggressive, and just going for every serve, whether it's first or second. It's obviously very hard to play like that.
"On his first serves, to try to anticipate and read his serve, where he's going to go 140 miles per hour down the 'T' and also pretty good angle wide, it's hard to position yourself well. It is a gamble."
Federer 'super comfortable'
Federer's 6-2 6-3 win over Nadal in California was the first time he has beaten the Spaniard three times in a row, after the five-set triumph in Melbourne and victory in the 2015 Basel final.
The Swiss claims a new racquet has been one of the keys to a successful start to 2017.
"I think the backhand has gotten better because I have been able to put in so many hours with the [new] racquet now," said
"Really, since this year I feel super comfortable with the racquet, and I think I have also gained confidence stepping into it."
No. 3 seed Stan Wawrinka is now the highest-ranked player left in the tournament after world No.1 Andy Murray suffered a shock defeat in the second round.
In the women's draw, Czech Republic's Karolina Pliskova and Russian Svetlana Kuznetsova became the first players to reach the semifinals at Indian Wells.