½ pounds sweet potatoes, peeled and cut into ¼-inch slices (about 8 cups)
1. Position racks in upper and lower third of oven; preheat to 425°F.
2. Toss sweet potatoes with 1 tablespoon oil in a large bowl until well coated. Divide between 2 large baking sheets and spread in an even layer. Roast, rotating the pans from top to bottom about halfway through, until tender and beginning to brown, 20 to 25 minutes.
3. Meanwhile, heat the remaining 2 tablespoons oil in a large saucepan over medium heat. Add onion; cook, stirring frequently, until very soft and golden brown, 5 to 8 minutes. Add flour, salt and pepper; cook, stirring, for 1 minute more. Add milk; cook, stirring and scraping up any brown bits at the bottom of the pan. increase heat to medium high; cook, stirring, until the sauce thickens and bubbles, 3 to 5 minutes. Remove from heat.
4. When the sweet potatoes are done, remove them from the oven. Preheat the broiler. Transfer half the sweet potatoes to a 2-quart broiler-safe baking dish. Spread half the sauce over the sweet potatoes and top with ½ cup cheese. Add the remaining sweet potatoes and top with the remaining sauce and cheese. Broil, watching carefully, until the sauce is bubbling and the cheese is beginning to brown, 1 to 5 minutes, depending on your broiler. Let stand 10 minutes. Serve topped with rosemary.
To make ahead: Roast potatoes (Step 2) up to 30 minutes ahead. Prepare sauce(Step 3), cover and refrigerate for up to 1 day; gently reheat until steaming before combining with the potatoes and cheese.
Recipe courtesy of Eating Well