I think it is most likely to be the Queen of Thorns, assuming it was a fast-acting ingestible poison Tyrion and Sansa are also suspects and possible Tywin.
Assuming it is such a poison then there are two possibilities: the wine and the pie.
As to the wine, Joffery was presumably fine drinking out of the same cup for some time so it probably wasn’t poisoned before he had his last cup. Joffery knocked the cup out of Tyrion’s hand, Sansa picked it up, passed it to Tyrion who looked inside the cup and then to Joffery who also looked inside the cup. Joffery then put the cup down at his wife’s corner of the table. to cut the pie. After eating a little of the pie, Joffery asked for wine and Tyrion got up, poured him some wine out of Tywin’s decanter, and then Joffery choked and died.
Because Joffery looked inside the cup, it seems unlikely that Tyrion or Sansa could have placed a visible poison inside it w/o Joffery knowing. That doesn’t foreclose upon the opportunity that either party could have placed poison that would have otherwise been unnoticed inside the cup.
Joffery put the cup down on the bride’s side of the table. That corner was in front of Marjorie and very near both the Queen of Thorns and a king’s guard. Anyone one of the three could have reached over and poisoned the cup while everyone else was distracted watching Joffery cut the pie. Indeed, as Joffery put the cup down the camera stated focused on the Queen of Thorns in the background.
As to the pie, that might have contained the poison as well. The Queen of Thorns made a big point of being partially responsible for the food so she probably had access to the kitchen to poison the pie. Tywin also would have access to the kitchen as well.
The wine Joffery drank last was in front of Tywin. It seems possible that he might have poisoned it. However that seems unlikely b/c he was probably drinking out of the same decanter over the course of the meal and the remaining wine could be tested for poison.
As to motive, Tyrion and Sansa both have obvious motives to want Joffery dead. However, Tyrion is probably too smart to kill Joffery b/c Tyrion knows he is walking a very dangerous line w/ the rest of his family. Those concerns are probably lesser w/ Sansa. Indeed, Sansa wanted to leave as it becoming obvious that Joffery had cut the pie. Had she poisoned the cup then it would have been an ideal time to leave.
Tywin probably has motive to kill Joffery. He no doubt recognizes that Joffery has become unmanageable. By killing Joffery he would ensure his continued direct hand in governance by becoming regent for his other grandson.
I’m not sure what the Queen of Thorns motive to kill Joffery would be, but certainly she recognized he’s a madman as well. She does suggest that Sansa come to High Garden. If that was a play to move the last remaining Stark (that she knows of) into her family to make a future play for the throne. I could see her wanting to keep a Stark in her pocket to help legitimacy a future Tyrell ruler.
Cersi and Marjorie also has access to either the wine or the cup, respectively, and probably both had access to the kitchens for the pie. However, the two of them seem to be the only parties that actually care for Joffery and don’t want him killed.
There are plenty of other parties who want Joffery dead who could have poisoned the pie (most likely), but the parties above seem the most likely.