Butter or spray with baking spray a 9x13 inch casserole or baking dish. Set aside.
Add 2 cups of pecans to a baking sheet and roast for a few minutes. Watch closely to not burn them. Remove from oven, cool, and roughly chop.
Cook the Potatoes:
Peel, cube, and wash sweet potatoes. Add the cubed potatoes to a dutch oven or large saucepan. Cover with water and bring to a boil. Boil for about 15 minutes, when pierced with a fork, the potatoes should be tender.
Drain cooked sweet potatoes, mash, and set aside to cool off a bit.
While the potatoes are cooking, in a small bowl, using a fork mix together the softened butter, flour, sugar, and cinnamon until soft crumbs form. Set aside.
Combine all the ingredients from the "Pecan Topping" section except marshmallows. Stir and set aside.
Sweet Potato Layer:
Combined the slightly cooled mashed potatoes with the ingredients from the "For the Potatoes" section: brown sugar, melted butter, 1 cup chopped pecans, lightly beaten eggs, milk, salt, vanilla, cinnamon, and nutmeg. Stir to combine until smooth.
Assembling the Casserole:
Add half of the mashed sweet potatoes mix to the prepared pan, distribute evenly and smooth the top with a spatula.
Sprinkle half of the Cinnamon Filling mixture on top of the mashed potatoes.
Add the remaining sweet mashed potato filling, distribute evenly and smooth the top with a spatula.
Sprinkle the Pecan Filling mixture on top of the mashed potatoes.
Sprinkle the mini marshmallows if using.
Sprinkle the remaining Cinnamon Filling mixture on top.
Bake for 30 minutes, until the filling is hot and the topping has browned.
If the marshmallow starts to brown too quickly, spray some foil with baking spray and cover the casserole, greased side down, careful to not touch the toppings.