Step 1Heat a heavy-bottomed pan and roast the semolina, stirring constantly, until it becomes fragrant, dry and slightly more opaque, 2 to 3 minutes; do not allow it to brown. Pour the semolina out onto a plate and set aside.
Step 2In the same pan heated over medium-high heat add the oil or ghee. Stir in the mustard seeds and fry until they crackle and jump, about 1 minute.
Step 3Reduce the heat and add the cumin seeds, both dals and the cashews. Fry, stirring frequently, until the dals and cashews are a light golden brown, 1 to 3 minutes.
Step 4Add the onion and fry, stirring, until it is soft and fragrant, 3 to 5 minutes. Add the chiles, ginger and curry leaves and stir for one minute.
Step 5Add the water, salt and sugar. Taste and adjust the seasoning and sweetness if desired. Bring the mixture to a boil, then reduce heat to low.
Step 6Add the semolina in stages, stirring to incorporate each addition to avoid lumps. When all of the semolina has been incorporated, cover and steam the upma over low heat until the water has evaporated or been absorbed, and the porridge has come together, about 2 minutes.
Step 7Remove from heat. Stir in the cilantro leaves, reserving a few to sprinkle on each serving. Set the upma aside to rest for a few minutes before serving.